Skip to content

fix(teams): hide team creation when limit_circle_creation excludes the user - #2992

Merged
artonge merged 1 commit into
nextcloud:masterfrom
s0undy:fix/limit_circle_creation-frontend
Oct 28, 2026
Merged

artonge merged 1 commit into
nextcloud:masterfrom
s0undy:fix/limit_circle_creation-frontend

Conversation

@s0undy

@s0undy s0undy commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

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_creation in 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_creation is unset, the app's functionality is unchanged. Setting limit_circle_creation to 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_creation unset - Results in everyone being able to create teams (default setting)
  • limit_circle_creation set to id of admin user - Results in no other user being able to create teams [X]
  • limit_circle_creation set to id of a group - Results in members of the group being able to create teams [X]

Clearing limit_circle_creation when 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.
My Teams page without create permission

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".
My Teams page without any team membership or permission

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

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".
Dashboard widget

TODO

  • [ ]

Checklist

AI (if applicable)

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

@codecov

codecov Bot commented Oct 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@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.)

@Jerome-Herbinet

Copy link
Copy Markdown
Member

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

Cc @AndyScherzinger

@AndyScherzinger

Copy link
Copy Markdown
Member

thanks for the ping @Jerome-Herbinet - let me loop in @artonge

@s0undy
s0undy force-pushed the fix/limit_circle_creation-frontend branch from 1b59dd2 to 82914c1 Compare October 22, 2026 10:02
@s0undy

s0undy commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

@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 👍

@s0undy
s0undy force-pushed the fix/limit_circle_creation-frontend branch 2 times, most recently from 517fba7 to 864c110 Compare October 22, 2026 11:30
@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.)

…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>
@s0undy
s0undy force-pushed the fix/limit_circle_creation-frontend branch from 864c110 to e2bc622 Compare October 23, 2026 12:40

@artonge artonge left a comment

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.

Looks good. Only one nitpick (if actually relevent) :).

Comment thread src/teams/store.ts

@cristianscheid cristianscheid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks good to me

@artonge
artonge merged commit 091c2b4 into nextcloud:master Oct 28, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Frontend - Ability to restrict teams creation to defined group(s) / admins

5 participants