Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(systemtags): add setting to block non admin to create system tags #49514

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Altahrim
Copy link
Collaborator

@Altahrim Altahrim commented Nov 27, 2024

Summary

Allows admins to restrict tag creation to admins only

Switch with:

occ conf:app:set systemtags --type boolean only_admins_can_create --value 0|1

TODO

  • Add frontend switch in system tags settings
  • Change display on tag selection for users who can't create tags
  • Block color changing too

Checklist

@Altahrim Altahrim added this to the Nextcloud 31 milestone Nov 27, 2024
@Altahrim Altahrim self-assigned this Nov 27, 2024
@Altahrim Altahrim force-pushed the feat/restrict-tag-creation branch 4 times, most recently from d561ba1 to 7ed6833 Compare November 28, 2024 12:36
@Altahrim Altahrim force-pushed the feat/restrict-tag-creation branch from 7ed6833 to c158e06 Compare December 9, 2024 09:23
@nfebe nfebe force-pushed the feat/restrict-tag-creation branch 3 times, most recently from 8c7bd05 to 06bb2f1 Compare December 20, 2024 12:04
@nfebe nfebe force-pushed the feat/restrict-tag-creation branch 2 times, most recently from e27715d to d8d3c7e Compare January 2, 2025 14:55
@nfebe
Copy link
Contributor

nfebe commented Jan 6, 2025

Frontend switch

Enabled Disabled
enabled-tag-creation-non-admins disabled-tag-creation-non-admins

Error view

Error NA
error-cant-update-systag NA

@nfebe nfebe force-pushed the feat/restrict-tag-creation branch 3 times, most recently from 5b049ce to 5cf90d5 Compare January 13, 2025 14:12
@nfebe nfebe marked this pull request as ready for review January 13, 2025 14:15
@nfebe nfebe force-pushed the feat/restrict-tag-creation branch from 5cf90d5 to f7e6dc9 Compare January 13, 2025 14:51
Copy link
Member

@provokateurin provokateurin left a comment

Choose a reason for hiding this comment

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

Only minor things, LGTM

lib/private/SystemTag/SystemTagManager.php Show resolved Hide resolved
lib/private/SystemTag/SystemTagManager.php Outdated Show resolved Hide resolved
lib/public/SystemTag/ISystemTagManager.php Outdated Show resolved Hide resolved
lib/public/SystemTag/TagCreationForbiddenException.php Outdated Show resolved Hide resolved
tests/lib/SystemTag/SystemTagManagerTest.php Outdated Show resolved Hide resolved
@Altahrim Altahrim removed the 2. developing Work in progress label Jan 14, 2025
@Altahrim Altahrim force-pushed the feat/restrict-tag-creation branch from f7e6dc9 to 001ec5a Compare January 14, 2025 08:52
@Altahrim Altahrim added the 3. to review Waiting for reviews label Jan 14, 2025
@skjnldsv skjnldsv mentioned this pull request Jan 14, 2025
@nfebe nfebe force-pushed the feat/restrict-tag-creation branch from 0767e7b to 27b128d Compare January 16, 2025 11:24
@nfebe
Copy link
Contributor

nfebe commented Jan 16, 2025

/compile

@nfebe nfebe requested a review from skjnldsv January 16, 2025 11:24
@skjnldsv skjnldsv mentioned this pull request Jan 16, 2025
@Altahrim Altahrim force-pushed the feat/restrict-tag-creation branch from d99256f to 69f8d5e Compare January 17, 2025 14:16
Altahrim and others added 3 commits January 17, 2025 15:43
Added support for the `only_admin_can_create` flag in system tags.
The UI now hides the option to create tags when this flag is enabled, ensuring compliance with admin settings.

Signed-off-by: nfebe <[email protected]>
@Altahrim Altahrim force-pushed the feat/restrict-tag-creation branch from 69f8d5e to 76ad5e2 Compare January 17, 2025 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🏗️ In progress
Development

Successfully merging this pull request may close these issues.

5 participants