Skip to content

feature: Allow a team (circle) to own a board - #8266

Open
samin-z wants to merge 5 commits into
mainfrom
feat/8167-board-team
Open

feature: Allow a team (circle) to own a board #8266
samin-z wants to merge 5 commits into
mainfrom
feat/8167-board-team

Conversation

@samin-z

@samin-z samin-z commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Feature ticket: #8167

Summary

Allow teams to create boards belonging to them.

DONE

  1. add new api to add a Team board.
  2. on team owner leaving the team, the ownership of the board is transfered to the user with next highest level.
  3. on team deletion, or all members leaving the team, all the boards belonging to that team also get removed.

Since there is no FE yet, to test this API can be called to add new Team board:
/deck/api/v1.0/boards/team

body:
{
"title": "sample title",
"teamId":"sample team id",
"color": "sample color" (this filed is optional, can also not be sent since on the current design we have the board is created with no color)
}

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests (unit, integration, api and/or acceptance) are included
  • Documentation (manuals or wiki) has been updated or is not required

@github-actions

Copy link
Copy Markdown
Contributor

🐢 Performance warning.
It looks like the query count of the integration tests increased with this PR.
Database query count is now 200346 was 198420 (+0.97%)
Please check your code again. If you added a new test this can be expected and the base value in tests/integration/base-query-count.txt can be increased.

@github-actions

Copy link
Copy Markdown
Contributor

🐢 Performance warning.
It looks like the query count of the integration tests increased with this PR.
Database query count is now 200342 was 198420 (+0.96%)
Please check your code again. If you added a new test this can be expected and the base value in tests/integration/base-query-count.txt can be increased.

Signed-off-by: samin-z <samin.zavarkesh@gmail.com>
Signed-off-by: samin-z <samin.zavarkesh@gmail.com>
Signed-off-by: samin-z <samin.zavarkesh@gmail.com>
@samin-z
samin-z force-pushed the feat/8167-board-team branch from 776b999 to 530539d Compare August 26, 2026 12:20
@github-actions

Copy link
Copy Markdown
Contributor

🐢 Performance warning.
It looks like the query count of the integration tests increased with this PR.
Database query count is now 200806 was 198420 (+1.2%)
Please check your code again. If you added a new test this can be expected and the base value in tests/integration/base-query-count.txt can be increased.

@samin-z
samin-z force-pushed the feat/8167-board-team branch from bc51800 to f378743 Compare August 26, 2026 13:48
@github-actions

Copy link
Copy Markdown
Contributor

🐢 Performance warning.
It looks like the query count of the integration tests increased with this PR.
Database query count is now 200802 was 198420 (+1.2%)
Please check your code again. If you added a new test this can be expected and the base value in tests/integration/base-query-count.txt can be increased.

Signed-off-by: samin-z <samin.zavarkesh@gmail.com>
@samin-z
samin-z force-pushed the feat/8167-board-team branch from f378743 to d8f562b Compare August 26, 2026 13:56
@github-actions

Copy link
Copy Markdown
Contributor

🐢 Performance warning.
It looks like the query count of the integration tests increased with this PR.
Database query count is now 200852 was 198420 (+1.22%)
Please check your code again. If you added a new test this can be expected and the base value in tests/integration/base-query-count.txt can be increased.

@grnd-alt grnd-alt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works well and code is clean, got some small nitpicks though otherwise looks good 🔥

Comment thread lib/Controller/BoardApiController.php Outdated
#[NoAdminRequired]
#[NoCSRFRequired]
#[CORS]
public function createForTeam(string $title, string $teamId, ?string $color = null): DataResponse {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would prefer to have new endpoints only in the ocs controllers.

$circlesManager->startSuperSession();
$circle = $circlesManager->getCircle($circleId);
$circleMembers = [];
foreach ($circle->getMembers() as $member) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there not always an admin for a team?

can't we just search for the admin and give them the ownership? then we don't have to search through all the members and sort them and all that.

@jospoortvliet jospoortvliet Aug 26, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, Teams currently have an owner. Could be a temporary solution - but note that but we want to remove that role, as any role with a single person is something we want to avoid. Teams have admins and moderators - can have multiple of those.

Background that might be helpful: in the next release we will try to align team roles with roles in apps. I mean so that Team moderators would be moderators in Talk rooms owned by the team. And in the far future, we would like to be able to create and manage roles of team members (can manage ACL's, can create talk rooms, can moderate talk rooms, ...).

Comment thread lib/Controller/BoardController.php Outdated
}

#[NoAdminRequired]
public function createForTeam(string $title, string $teamId, ?string $color = null): Board {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also this preferably in ocs


$boards = $this->boardMapper->findAllByOwner($userId);
foreach ($boards as $board) {
if (in_array($board->getId(), $transferredBoardIds, true)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could drop some readability to prevent doing the same db query twice (findAllByOwner)
if we drop the transferTeamBoardsFromDeletedUser function and incorporate it's logic into the for loop we already have. Not required by me though.

Either way I think the transferredBoardIds array has no effect on the logic here right? All the ids in there have a different owner by now so are not in the $boards array anyway...

@github-actions

Copy link
Copy Markdown
Contributor

🐢 Performance warning.
It looks like the query count of the integration tests increased with this PR.
Database query count is now 200866 was 198420 (+1.23%)
Please check your code again. If you added a new test this can be expected and the base value in tests/integration/base-query-count.txt can be increased.

Signed-off-by: samin-z <samin.zavarkesh@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review
Status: 🏗️ At engineering

Development

Successfully merging this pull request may close these issues.

Support creating Deck boards owned by teams Allow a team (circle) to own a board

4 participants