mirror of
https://github.com/flarum/framework.git
synced 2025-01-20 05:32:49 +08:00
Permission Tag Scoping Field (#127)
This allows tag scoping permissions that don't start with `discussion`, or on the contrary, removing tag scoping from permissions that DO start with `discussion`. Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
This commit is contained in:
parent
dfbb468744
commit
99009e5d3b
|
@ -32,7 +32,8 @@ export default function() {
|
||||||
render: item => {
|
render: item => {
|
||||||
if (item.permission === 'viewDiscussions'
|
if (item.permission === 'viewDiscussions'
|
||||||
|| item.permission === 'startDiscussion'
|
|| item.permission === 'startDiscussion'
|
||||||
|| (item.permission && item.permission.indexOf('discussion.') === 0)) {
|
|| (item.permission && item.permission.indexOf('discussion.') === 0 && item.tagScoped !== false)
|
||||||
|
|| item.tagScoped) {
|
||||||
return PermissionDropdown.component({
|
return PermissionDropdown.component({
|
||||||
permission: 'tag' + tag.id() + '.' + item.permission,
|
permission: 'tag' + tag.id() + '.' + item.permission,
|
||||||
allowGuest: item.allowGuest
|
allowGuest: item.allowGuest
|
||||||
|
|
Loading…
Reference in New Issue
Block a user