fix: prevent manage system assignment from manage groups permission
This commit is contained in:
parent
a06201aaf5
commit
78d02dc8e5
@ -173,6 +173,14 @@ module.exports = {
|
|||||||
throw new gql.GraphQLError('You are not authorized to manage this group or assign these permissions.')
|
throw new gql.GraphQLError('You are not authorized to manage this group or assign these permissions.')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check assigned permissions for manage:groups
|
||||||
|
if (
|
||||||
|
WIKI.auth.checkExclusiveAccess(req.user, ['manage:groups'], ['manage:system']) &&
|
||||||
|
args.permissions.some(p => _.last(p.split(':')) === 'system')
|
||||||
|
) {
|
||||||
|
throw new gql.GraphQLError('You are not authorized to manage this group or assign the manage:system permissions.')
|
||||||
|
}
|
||||||
|
|
||||||
// Update group
|
// Update group
|
||||||
await WIKI.models.groups.query().patch({
|
await WIKI.models.groups.query().patch({
|
||||||
name: args.name,
|
name: args.name,
|
||||||
|
Loading…
Reference in New Issue
Block a user