Skip to content

Feature/implement default quota for groups - #2858

Open
hefftich wants to merge 7 commits into
nextcloud:masterfrom
Dataport:feature/implement_default_Quota_for_Groups
Open

hefftich wants to merge 7 commits into
nextcloud:masterfrom
Dataport:feature/implement_default_Quota_for_Groups

Conversation

@hefftich

Copy link
Copy Markdown

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

  • Bob is a member in the groups marketing and engineering. He creates a new team, which gets a quota of 5 GB.
  • Alice is not a member of any groups defined in this list. Her newly created team gets a quota of 100 MB.

TODO

  • ...

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI
autocreation disabled banner

@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/teams/api.ts 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@tomek2k1 tomek2k1 moved this from Backlog to In progress in 👥 Teams Sep 2, 2026
@tomek2k1 tomek2k1 moved this from In progress to In review in 👥 Teams Sep 2, 2026
Comment thread appinfo/info.xml
Comment thread lib/ConfigLexicon.php Outdated
@hefftich
hefftich enabled auto-merge September 2, 2026 14:08
Comment thread appinfo/info.xml
Comment thread lib/ConfigLexicon.php Outdated
Comment thread src/teams/api.ts
Comment thread lib/Service/TeamFolderPolicy.php Outdated
Comment thread lib/ConfigLexicon.php Outdated
Comment thread lib/Controller/TeamFolderController.php
Comment thread lib/Controller/AdminController.php
Comment thread lib/Service/TeamFolderPolicy.php Outdated
@hefftich hefftich self-assigned this Sep 2, 2026
@hefftich
hefftich force-pushed the feature/implement_default_Quota_for_Groups branch 12 times, most recently from 761bc23 to 7d60718 Compare September 4, 2026 08:01
@hefftich

hefftich commented Sep 4, 2026

Copy link
Copy Markdown
Author

/backport to stable35

@hefftich
hefftich force-pushed the feature/implement_default_Quota_for_Groups branch 4 times, most recently from cb7a826 to ba69061 Compare September 9, 2026 08:42
@artonge

artonge commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

/compile amend /

@cristianscheid

Copy link
Copy Markdown
Member

/compile

@artonge

artonge commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Compile bot is failing because the PR comes from a fork.
Seems like I can compile something locally, but cannot push as you did not autorised repo admin to push to your branch.
So either you autorise me, or you try again compiling locally.

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>
@tomek2k1
tomek2k1 force-pushed the feature/implement_default_Quota_for_Groups branch from 81742c7 to 9a61ea4 Compare September 11, 2026 09:24
@tomek2k1

tomek2k1 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Compile bot is failing because the PR comes from a fork. Seems like I can compile something locally, but cannot push as you did not autorised repo admin to push to your branch. So either you autorise me, or you try again compiling locally.

I rebuilt it locally. It should be good now.

Signed-off-by: Louis Chmn <louis@chmn.me>
@artonge
artonge force-pushed the feature/implement_default_Quota_for_Groups branch from 8a1f00d to 467e24d Compare September 11, 2026 10:16
Comment thread lib/Service/TeamFolderPolicy.php Outdated
Comment thread lib/Service/TeamFolderPolicy.php Outdated
Comment on lines +154 to +165
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;
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

@hefftich hefftich Sep 14, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@artonge, @jospoortvliet, @marcoambrosini
My understanding of the requirement is that both groups and teams can be used as quota mappings. I have already added the mapping to the admin UI. I am a bit confused:

Please look here

When a user creates a new team, we should collect the default, all matching group quotas, and all matching quotas from teams the user is a member of, then apply the highest value. 0 remains unlimited and therefore takes precedence.

Would you prefer a different priority model, where team membership quotas are only considered if no matching group quota exists? I think that would be a valid alternative, but it would make groups override teams rather than treating both mapping types equally.

What do you think about?

Comment thread lib/Service/TeamFolderPolicy.php
Comment thread lib/Service/TeamFolderPolicy.php Outdated
Comment thread lib/Search/LocalUsers.php
Comment thread lib/Controller/AdminController.php Outdated
@hefftich
hefftich force-pushed the feature/implement_default_Quota_for_Groups branch 2 times, most recently from 4b12d53 to c9810e4 Compare September 14, 2026 21:43
@hefftich
hefftich requested a review from artonge September 14, 2026 21:58
@github-actions

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Co-authored-by: Copilot <copilot@github.com> GPT-5.6 Terra
Signed-off-by: Stefan Lender <Stefan.Lender@dataport.de>
@hefftich
hefftich force-pushed the feature/implement_default_Quota_for_Groups branch 3 times, most recently from 7d15270 to eac2c64 Compare September 15, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

7 participants