diff --git a/apps/systemtags/src/components/SystemTags.vue b/apps/systemtags/src/components/SystemTags.vue index 1f2b38bf10aaa..78b6e204cdcc0 100644 --- a/apps/systemtags/src/components/SystemTags.vue +++ b/apps/systemtags/src/components/SystemTags.vue @@ -51,6 +51,8 @@ import { setTagForFile, } from '../services/files.js' +import { loadState } from '@nextcloud/initial-state' + import type { Tag, TagWithId } from '../types.js' export default Vue.extend({ @@ -188,6 +190,10 @@ export default Vue.extend({ this.sortedTags.unshift(createdTag) this.selectedTags.push(createdTag) } catch (error) { + if(loadState('settings', 'onlyAdminsCanCreateSystemTags', '1') === '1') { + showError(t('systemtags', 'System admin disabled tag creation. You can only use existing ones.')) + return + } showError(t('systemtags', 'Failed to create tag')) } this.loading = false diff --git a/apps/systemtags/src/files_actions/bulkSystemTagsAction.ts b/apps/systemtags/src/files_actions/bulkSystemTagsAction.ts index b0d68ef65ca13..2d60d7ae74226 100644 --- a/apps/systemtags/src/files_actions/bulkSystemTagsAction.ts +++ b/apps/systemtags/src/files_actions/bulkSystemTagsAction.ts @@ -10,6 +10,8 @@ import { isPublicShare } from '@nextcloud/sharing/public' import { spawnDialog } from '@nextcloud/dialogs' import { t } from '@nextcloud/l10n' +import { loadState } from '@nextcloud/initial-state' + import TagMultipleSvg from '@mdi/svg/svg/tag-multiple.svg?raw' /** @@ -34,6 +36,10 @@ export const action = new FileAction({ // If the app is disabled, the action is not available anyway enabled(nodes) { + if (loadState('settings', 'onlyAdminsCanCreateSystemTags', '1') === '1') { + return false + } + if (isPublicShare()) { return false }