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

Merged
merged 4 commits into from
Jan 22, 2025

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 Outdated 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
@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 2 times, most recently from 69f8d5e to 76ad5e2 Compare January 17, 2025 14:43
@nfebe nfebe force-pushed the feat/restrict-tag-creation branch from 76ad5e2 to 2df437f Compare January 18, 2025 22:11
@nfebe
Copy link
Contributor

nfebe commented Jan 18, 2025

/compile

@Altahrim Altahrim force-pushed the feat/restrict-tag-creation branch from 2fcd63f to 4840a06 Compare January 20, 2025 11:59
@Altahrim Altahrim enabled auto-merge January 20, 2025 11:59
@Altahrim Altahrim force-pushed the feat/restrict-tag-creation branch from 4840a06 to dc9f724 Compare January 20, 2025 12:07
@nextcloud-command nextcloud-command force-pushed the feat/restrict-tag-creation branch from b7a29e3 to ff81fb9 Compare January 20, 2025 19:27
@Altahrim Altahrim mentioned this pull request Jan 21, 2025
@nfebe nfebe force-pushed the feat/restrict-tag-creation branch from ff81fb9 to a0b0ea3 Compare January 21, 2025 09:34
@nfebe
Copy link
Contributor

nfebe commented Jan 21, 2025

/compile

Copy link
Contributor

@artonge artonge left a comment

Choose a reason for hiding this comment

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

Nitpicking on the naming. But not blocking :)

apps/settings/lib/Settings/Admin/Server.php Outdated Show resolved Hide resolved
@Altahrim Altahrim force-pushed the feat/restrict-tag-creation branch from cd5a4a8 to 7c4295c Compare January 21, 2025 13:26
@Altahrim
Copy link
Collaborator Author

/compile

@nfebe nfebe force-pushed the feat/restrict-tag-creation branch from 55cb8bb to b18f4d7 Compare January 22, 2025 19:01
@nfebe
Copy link
Contributor

nfebe commented Jan 22, 2025

/compile

Altahrim and others added 3 commits January 22, 2025 20:07
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
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 <fenn25.fn@gmail.com>
@nfebe nfebe force-pushed the feat/restrict-tag-creation branch from 543c295 to abf840b Compare January 22, 2025 19:13
@nfebe
Copy link
Contributor

nfebe commented Jan 22, 2025

/compile

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@Altahrim Altahrim merged commit c10b8e2 into master Jan 22, 2025
189 checks passed
@Altahrim Altahrim deleted the feat/restrict-tag-creation branch January 22, 2025 19:39
@Altahrim Altahrim mentioned this pull request Jan 23, 2025
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.

7 participants