Feature/implement default quota for groups - #2858
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
761bc23 to
7d60718
Compare
|
/backport to stable35 |
@jospoortvliet I think we should also allow teams here, more flexible for everyone. But agree that we need groups for example: if you already have a "management" team, it's useful to be able to use that for trusting the members with a higher quota, instead to having to recreate that to a group. What do you think? |
I don't think supporting teams is a problem - for small orgs it makes sense. Big orgs will likely want this in LDAP where other policies are handled, too, so groups would be the basis I think. |
|
@jospoortvliet The issue in the 3rd screenshot is a bug in the groupfolders project. |
|
@jospoortvliet I’ve fixed the bug relating to adding folders to existing teams that don’t yet have a team space #2890 |
@jospoortvliet @marcoambrosini I implemented your suggestion. Teams and groups can now be selected. |
0f6c8e9 to
563e2bb
Compare
That works for me then. @alimmroth FYI |
cb7a826 to
ba69061
Compare
|
/compile amend / |
|
/compile |
|
Compile bot is failing because the PR comes from a fork. |
Co-authored-by: Copilot <copilot@github.com> GPT-5.6 Terra Signed-off-by: Stefan Lender <Stefan.Lender@dataport.de>
Co-authored-by: Copilot <copilot@github.com> GPT-5.6 Terra Signed-off-by: Stefan Lender <Stefan.Lender@dataport.de>
Signed-off-by: Stefan Lender <Stefan.Lender@dataport.de>
Signed-off-by: Stefan Lender <Stefan.Lender@dataport.de>
81742c7 to
9a61ea4
Compare
I rebuilt it locally. It should be good now. |
Signed-off-by: Louis Chmn <louis@chmn.me>
8a1f00d to
467e24d
Compare
| $matches = $override === null ? [] : [$override]; | ||
| $owner = $circle->getOwner(); | ||
| if (!$owner->isLocal()) { | ||
| return $matches === [] ? $fallback : ($matches[0] ?? $fallback); |
There was a problem hiding this comment.
Isn't this simpler and the same?
| return $matches === [] ? $fallback : ($matches[0] ?? $fallback); | |
| return $quota; |
| $override = $this->getTeamFolderQuota($circle); | ||
| $fallback = $this->getDefaultQuota(); |
There was a problem hiding this comment.
| $override = $this->getTeamFolderQuota($circle); | |
| $fallback = $this->getDefaultQuota(); | |
| $quota = $this->getTeamFolderQuota($circle) ?? $this->getDefaultQuota(); |
| foreach ($this->membershipRequest->getMemberships($owner->getSingleId()) as $membership) { | ||
| try { | ||
| $membershipCircle = $this->circleRequest->getCircle($membership->getCircleId()); | ||
| } catch (CircleNotFoundException) { | ||
| continue; | ||
| } | ||
|
|
||
| $quota = $this->getTeamFolderQuota($membershipCircle); | ||
| if ($quota !== null) { | ||
| $matches[] = $quota; | ||
| } | ||
| } |
There was a problem hiding this comment.
This means the quota for a unrelated team impacts the quota of the current team if the current user is part of both?
Is this really what we want?
| * Resolve the highest configured team or group quota for the local team owner. | ||
| * Unlimited (0) takes precedence over every finite quota. | ||
| */ | ||
| public function getQuotaForCircle(Circle $circle): int { |
There was a problem hiding this comment.
Probably a less complex version of it:
| public function getQuotaForCircle(Circle $circle): int { | |
| public function getQuotaForCircle(Circle $circle): int { | |
| $quotas = [ | |
| $this->getTeamFolderQuota($circle) ?? $this->getDefaultQuota(), | |
| ...$this->getMatchingGroupQuotas($owner->getUserId()), | |
| ]); | |
| if (in_array(0, $matches, true)) { | |
| return 0; | |
| } | |
| return max(quotas); | |
| } |
| } | ||
|
|
||
| /** @return list<int> */ | ||
| private function getMatchingGroupQuotas(string $userId): array { |
There was a problem hiding this comment.
| private function getMatchingGroupQuotas(string $userId): array { | |
| private function getGroupQuotaForUser(string $userId): array { |
There was a problem hiding this comment.
This should either be properly addressed in another PR, or not be part of this PR.
| $teamFolders = []; | ||
| foreach ($this->circleService->getAllCircles($probe) as $circle) { | ||
| $folder = $provider->getTeamFolder($circle->getSingleId()); | ||
| $folder = $provider?->getTeamFolder($circle->getSingleId()); |
There was a problem hiding this comment.
Should be ok at this point
| $folder = $provider?->getTeamFolder($circle->getSingleId()); | |
| $folder = $provider->getTeamFolder($circle->getSingleId()); |






Implement a default quota per group. #2895
Summary
We need a way for admins to set default quotas for team folder creation, based on group membership. This needs a group -> quota mapping in the Teams admin settings.
Admin settings --> Teams
- In the Team settings, admins can add entries to a table, defining default quotas for groups.
- When a user creates a new team, the highest quota of the groups, this user is a member of, gets applied to the new Team folder.
- At least a line for "all" is always present in the table, which is applied at team creation, when the user isn't a member of any other quota group.
- The three-dot menu lets admins delete any mapping, despite "all".
- The quotas only get applied at team creation. An admin can alway change the quota of existing teams later on.
group | default quota | options -- | -- | -- all | 100 MB | marketing | 2 GB | ... sales | 10 GB | ... engineering | 5 GB | ...Examples
marketingandengineering. He creates a new team, which gets a quota of 5 GB.TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)