diff --git a/extensions/tags/js/admin/src/addTagPermission.js b/extensions/tags/js/admin/src/addTagPermission.js new file mode 100644 index 000000000..498c4ce2b --- /dev/null +++ b/extensions/tags/js/admin/src/addTagPermission.js @@ -0,0 +1,11 @@ +import { extend } from 'flarum/extend'; +import PermissionGrid from 'flarum/components/PermissionGrid'; + +export default function() { + extend(PermissionGrid.prototype, 'moderateItems', items => { + items.add('tag', { + label: 'Edit tags', + permission: 'discussion.tag' + }); + }); +} diff --git a/extensions/tags/js/admin/src/main.js b/extensions/tags/js/admin/src/main.js index c7f47901d..e0679f943 100644 --- a/extensions/tags/js/admin/src/main.js +++ b/extensions/tags/js/admin/src/main.js @@ -1,10 +1,12 @@ import Tag from 'tags/models/Tag'; import addTagsPermissionScope from 'tags/addTagsPermissionScope'; +import addTagPermission from 'tags/addTagPermission'; import addTagsPane from 'tags/addTagsPane'; app.initializers.add('tags', app => { app.store.models.tags = Tag; addTagsPermissionScope(); + addTagPermission(); addTagsPane(); });