Promote the 2026-08-30 review security fixes and supplies ordering to main
This commit is contained in:
@@ -351,19 +351,20 @@ def update_role(roleid: int):
|
||||
# Update permissions
|
||||
if 'permissions' in data and role.rolename != 'admin':
|
||||
# The guest role is anyone with no account, so what it may hold is
|
||||
# bounded: reads, plus the handful of writes a plugin has explicitly
|
||||
# declared safe to do anonymously. Refused at the door rather than
|
||||
# warned about - a checkbox that quietly makes deleting an asset
|
||||
# anonymous is not a warning anybody reads twice.
|
||||
# bounded to what core or a plugin has explicitly declared grantable.
|
||||
# Refused at the door rather than warned about - a checkbox that
|
||||
# quietly makes deleting an asset anonymous is not a warning anybody
|
||||
# reads twice.
|
||||
if role.rolename == Role.GUEST:
|
||||
allowed = guest_grantable_permissions()
|
||||
refused = sorted(set(data['permissions']) - allowed)
|
||||
if refused:
|
||||
return error_response(
|
||||
ErrorCodes.VALIDATION_ERROR,
|
||||
'The guest role cannot hold {}. A guest may be granted any '
|
||||
'view permission, and only writes a plugin has declared '
|
||||
'safe to do without an account.'.format(', '.join(refused)))
|
||||
'The guest role cannot hold {}. A guest may only be '
|
||||
'granted permissions core or the owning plugin has '
|
||||
'declared grantable, which is a code change rather than a '
|
||||
'setting.'.format(', '.join(refused)))
|
||||
old_perms = [p.name for p in role.permissions]
|
||||
perms = Permission.query.filter(Permission.name.in_(data['permissions'])).all()
|
||||
new_perms = [p.name for p in perms]
|
||||
|
||||
Reference in New Issue
Block a user