Add permission setting for editing tags

This commit is contained in:
Toby Zerner 2015-08-13 12:52:43 +09:30
parent ee87ada0af
commit 658896eeb1
2 changed files with 13 additions and 0 deletions

View File

@ -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'
});
});
}

View File

@ -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();
});