Commit e5cbf6b9 authored by NGPixel's avatar NGPixel Committed by Nicolas Giard

fix: prevent manage system assignment from manage groups permission

parent 7715dc6f
......@@ -167,6 +167,14 @@ module.exports = {
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
await WIKI.models.groups.query().patch({
name: args.name,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment