Repository navigation
fix(teams): hide team creation when limit_circle_creation excludes the user - #2992
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
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.) |
|
Hello @s0undy Do you have a problem with this PR ; did the reviewers told you something about it ? We would love to get it merged as soon as possible. Thanks |
|
thanks for the ping @Jerome-Herbinet - let me loop in @artonge |
1b59dd2 to
82914c1
Compare
|
@Jerome-Herbinet I have no issues with it, just waiting for a review. I went ahead and rebased it, so CI will have to run again, but everything still tests cleanly locally. Thanks for looping in the right people 👍 |
517fba7 to
864c110
Compare
|
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.) |
…e user Expose whether the current user may create teams as initial state on the Teams page and the dashboard widget, and hide every creation entry point (home banner, empty states, team switcher, dashboard widget button) when limit_circle_creation is set and the user has no permission. Fixes nextcloud#1940 Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Anton Josefsson <antonjosefsson@hotmail.se>
864c110 to
e2bc622
Compare
artonge
left a comment
There was a problem hiding this comment.
Looks good. Only one nitpick (if actually relevent) :).
Following the comments in #1940 I thought I'd give contributing a fix/feature a shot.
Summary
Uses existing permission check in the backend to visually enforce the same permissions on the frontend. If the user does not have permission to create teams the frontend hides the possibility.
While setting
limit_circle_creationin the config resulted in team creation being limited accordingly it was only being enforced on the backend. Users that weren't allowed to create teams still had every button visible in the frontend that presented them with the possibility of creating teams. However when trying to create a team they were met with the error "You have no permission to create a new team" and nothing more.With the changes in the PR, when
limit_circle_creationis unset, the app's functionality is unchanged. Settinglimit_circle_creationto a user or group hides the possibility for everyone else but the group to create new teams.I also decided to edit the descriptive text that was being shown when the user was not a member of any team. Now when the user is unable to create a team only the icon and title are shown, description and buttons are hidden.
This could possibly be changed to something similar to what is being shown when a team has no team folder "You are not a member of any team. Ask your administrator to create a team".
With the changes I've tested creating teams with:
limit_circle_creationunset - Results in everyone being able to create teams (default setting)limit_circle_creationset to id of admin user - Results in no other user being able to create teams [X]limit_circle_creationset to id of a group - Results in members of the group being able to create teams [X]Clearing
limit_circle_creationwhen it previously was a user/group results in default setting (everyone can create teams)Screenshots
My teams page no longer shows "New team" in the header.

When the user is not a member of any team it does not show "Create your first team to start collaborating." or the button "Create your first team".

When the user is a member of a team the team submenu does not show the "New team" button.

While not a member of any team the dashboard widget does not display the "Join or create teams to see them here." or the button "Create your first team".

TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)