feat: control team space provisioning via app config - #2743
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
af1f1eb to
d31ced6
Compare
d31ced6 to
adf249b
Compare
| * Defaults to true when unset. OCC upgrade commands bypass this gate. | ||
| */ | ||
| public function isTeamFolderProvisioningEnabled(): bool { | ||
| $value = $this->config->getSystemValue(self::SYSTEM_TEAM_FOLDER_AUTO_CREATE, null); |
There was a problem hiding this comment.
Can't this be an app config instead?
There was a problem hiding this comment.
I would try to avoid 'poluting' the system config for such specific configs
There was a problem hiding this comment.
It can be app config technically, but we put it in config.php on purpose.
This PR follows the direction from @jospoortvliet on #2698: keep the strong default (teams + team spaces), and if a restriction is needed, only allow it in config.php so it is not the first thing admins reach for in the UI (and so we do not treat Nextcloud Teams like a feature to turn off). #2698 had this as an admin/app setting; we closed that PR in favor of this one for that reason.
App config would still be changeable via occ config:app:set and is easy to surface again in admin settings later. System config keeps this as an explicit ops-level opt-out, which matches that discussion.
Happy to revisit if you still prefer app config with the UI kept out.
There was a problem hiding this comment.
Yes, let's keep it in the app config :)
artonge
left a comment
There was a problem hiding this comment.
This is still a system config and not an app config
| public function isTeamFolderProvisioningEnabled(): bool { | ||
| $value = $this->config->getSystemValue(self::SYSTEM_TEAM_FOLDER_AUTO_CREATE, null); |
There was a problem hiding this comment.
To make sure that it is not miss-used.
| public function isTeamFolderProvisioningEnabled(): bool { | |
| $value = $this->config->getSystemValue(self::SYSTEM_TEAM_FOLDER_AUTO_CREATE, null); | |
| public function isTeamFolderAutoProvisioningEnabled(): bool { | |
| $value = $this->config->getSystemValue(self::SYSTEM_TEAM_FOLDER_AUTO_CREATE, null); |
There was a problem hiding this comment.
Agreed the name is easy to misread, but …AutoProvisioning… would be the wrong contract.
This flag is meant to stop user provisioning (create + UI/API self-upgrade), not only auto-create, so quota stays under admin control. OCC is not gated.
Happy to rename to something like isUserTeamFolderProvisioningEnabled instead.
There was a problem hiding this comment.
If this is not about auto-provisioning, let's rename the name of the config
| /** | ||
| * Admin escape hatch to provision team spaces for existing teams. | ||
| * | ||
| * This bypasses the config.php gate (`circles.team_folder_auto_create`) that |
There was a problem hiding this comment.
This is not a bypass if the config is only about blocking auto-provisioning.
There was a problem hiding this comment.
Fair on the wording. OCC is the admin path and must keep working when user provisioning is off. I will drop “bypass” in comments/docs and say: user paths honour the flag, OCC does not.
There was a problem hiding this comment.
see above - do what is quickest.
|
This PR is the original plan after #2698 / Jos: teams stay creatable, but user team-folder provisioning can be switched off so quota stays under admin control (OCC still works). That is not really #2744 (optional skip per team in the wizard). Happy to open a dedicated issue and retarget if that helps. |
|
Hello there, 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.) |
yeah, two different things. just discussed - so this doesn't have to be in config.php, just not visible in the admin UI - if it can be switched via the command line (occ or editing a config file), it's fine. So to be configured with something like But we agreed it is not a big deal either way, so @lennart441 do what is quickest for you:
So whatever works ;-) |
|
Moved the flag from system/ occ config:app:set circles team_folder_auto_create --value="false" --type=booleanStill not in admin UI. User paths (auto-create + UI/API upgrade) honour it; |
87522db to
45dd509
Compare
|
/backport to stable35 |
There was a problem hiding this comment.
I don't think we need that command.
There was a problem hiding this comment.
Just to clarify: do you mean only circles:team-folder:upgrade, or the whole PR (app-config kill switch for user provisioning)?
If it’s only the OCC command, I can drop it and keep the app-config flag. Note that with the flag off there would then be no admin path to provision spaces unless we leave UI/API upgrade open.
If you mean the whole approach isn’t needed anymore, I’ll close the PR — happy to confirm before I do that. (Context: this would be the second PR on this topic after #2698 that we implemented based on earlier feedback and then walked back.)
There was a problem hiding this comment.
I only mean the command.
I don't see use cases to allow bypassing the app-config flag.
|
Dropped |
There was a problem hiding this comment.
Probably not needed anymore.
|
And please cleanup your git history |
84fb222 to
b32e5ef
Compare
Squashed to a single commit on current master |
Keep the flag off the admin UI; set it with occ config:app:set. When disabled, auto-create and Circles UI/API upgrade are blocked. Signed-off-by: Lennart Joswig <mail@ljoswig.de> Co-authored-by: Cursor <cursoragent@cursor.com>
4110db4 to
00a5cd1
Compare
|
|
||
| import 'cropperjs/dist/cropper.css' | ||
|
|
||
| const teamFolderProvisioningEnabled = Boolean(loadState('circles', 'teamFolderProvisioningEnabled', true)) |
There was a problem hiding this comment.
Thanks for the extra look.
The initial state / canCreateTeamFolder check is intentional, not leftover from the OCC command.
The goal is that admins can keep quota fully under their control. If team_folder_auto_create is off, users should not be able to consume team-space quota — whether the folder is created with the team or attached afterwards via the UI. Those two paths are the same from a quota perspective.
So we hide the upgrade action in the UI (and the API already returns 403) when the flag is off. Auto-create-only would still let someone create a team first and add the space later.
At least, that was my intention.
|
/backport to stable35 |
|
The backport to # Switch to the target branch and update it
git checkout stable35
git pull origin stable35
# Create the new backport branch
git checkout -b backport/2743/stable35
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 00a5cd1a
# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/2743/stable35Error: Failed to check for changes with origin/stable35: No changes found in backport branch Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports. |
feat: kill switch for user team-folder provisioning (app config, no admin UI)
Assisted by: Cursor
Related:
Summary
Kill switch for user team-folder provisioning so admins keep quota control. Teams stay creatable.
When disabled:
occ config:app:set circles team_folder_auto_create --value="false" --type=booleanDefault remains on. Not exposed in admin settings. Not group-based team-creation limits (#2698). Not per-team wizard skip (#2744).
Checklist
Admin toggle removed; no new UI surfaces
Documented in PR description (
occ config:app:set)no
3. to review, feature component)stable32)AI (if applicable)