Repository navigation
Conversation
8bb4fa9 to
c58d195
Compare
Should I wait for this? Or is this ready to review now? |
It's ready for review. This is just for the ability of teams to own tables. The integration into Teams as resources will be done in nextcloud/circles#3187. |
| $this->tableService->delete($table->getId(), $userId); | ||
| } | ||
| } catch (InternalError|NotFoundError|PermissionError $e) { | ||
| $this->logger->error('Could not clean up a table for a deleted user', [ |
There was a problem hiding this comment.
if table owner is deleted while the Circles app is disabled, the ownership transfer does not happen and the table stays owned by the deleted user. when Circles is enabled again the ownership should move to the next user in team, the same way it does when Circles is enabled at the time of deletion.
There was a problem hiding this comment.
I handled it like this: circles is queried for an eligible successor. if circles is disabled/unavailable it leaves them untouched and has a background job running waiting for circles to be avaialbe again and then retrys the handover mechanism
| throw new PermissionError('PermissionError: can not change table owner with table id ' . $id); | ||
| } | ||
| $previousOwnerUserId = $table->getOwnership(); | ||
| $table->setOwnership($newOwnerUserId); |
There was a problem hiding this comment.
i noticed something, if table's ownership is transferred to someone outside the team, team_id will stay set in the database, so if the team is deleted the table will be deleted too eventhough it has a new owner now.
There was a problem hiding this comment.
I prevented changing the ownership to someone outside the team all along. That should handle it as the Table is supposed to be owned by the team
| $member = $event->getMember(); | ||
| if ($member->getUserType() === Member::TYPE_USER && $member->isLocal()) { | ||
| try { | ||
| $this->tableService->handleTeamStewardDeparture($event->getCircle()->getSingleId(), $member->getUserId()); |
There was a problem hiding this comment.
when a user is deleted this runs again after 'UserDeletedListener' already transferred the table. 'findAllByTeamId' finds nothing because the owner has changed, so the second run does nothing.
There was a problem hiding this comment.
The second listener should handle the case where the circle has no eligible members to become successor. (eg. only non-local members) This is something i am not quite sure on how we should handle this.
Allow team members to create team-attached tables through the API. Keep the user owner and an ordinary team share, handing ownership over or cleaning up tables when the owner leaves or the team is deleted. Assisted-by: Copilot:gpt-6.1-sol Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Stefan Dietrich <stefan.dietrich@dataport.de>
c58d195 to
9b7859d
Compare
Add the ability for teams to own tables. Introduces a teamId property on a table indicating that it belogs to a team instead of a single user.
This PR provides the technical foundation for teams to be able to own a table - the full integration with teams will be done in a separate task
Resolves #3221 partly. Still waiting on the interface to register as a team-app
🖼️ Screenshots
🏁 Checklist
/backport to stableX.X🤖 AI (if applicable)