mirror of
https://github.com/flarum/framework.git
synced 2024-12-02 06:53:47 +08:00
Add permission setting for editing tags
This commit is contained in:
parent
ee87ada0af
commit
658896eeb1
11
extensions/tags/js/admin/src/addTagPermission.js
Normal file
11
extensions/tags/js/admin/src/addTagPermission.js
Normal 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'
|
||||
});
|
||||
});
|
||||
}
|
|
@ -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();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user