mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Refuse to add visitors to mail / xmpp / ... permission as it doesnt make sense
This commit is contained in:
parent
698f31943a
commit
bd02678275
2 changed files with 5 additions and 0 deletions
|
@ -429,6 +429,7 @@
|
|||
"permission_update_failed": "Could not update permission '{permission}' : {error}",
|
||||
"permission_updated": "Permission '{permission:s}' updated",
|
||||
"permission_update_nothing_to_do": "No permissions to update",
|
||||
"permission_require_account": "Permission {permission} only makes sense for users having an account, and therefore cannot be enabled for visitors.",
|
||||
"port_already_closed": "Port {port:d} is already closed for {ip_version:s} connections",
|
||||
"port_already_opened": "Port {port:d} is already opened for {ip_version:s} connections",
|
||||
"port_available": "Port {port:d} is available",
|
||||
|
|
|
@ -100,6 +100,10 @@ def user_permission_update(operation_logger, permission, add=None, remove=None,
|
|||
if "." not in permission:
|
||||
permission = permission + ".main"
|
||||
|
||||
# Refuse to add "visitors" to mail, xmpp ... they require an account to make sense.
|
||||
if add and "visitors" in add and permission.split(".")[0] in SYSTEM_PERMS:
|
||||
raise YunohostError('permission_require_account', permission=permission)
|
||||
|
||||
# Fetch currently allowed groups for this permission
|
||||
|
||||
existing_permission = user_permission_list(full=True)["permissions"].get(permission, None)
|
||||
|
|
Loading…
Add table
Reference in a new issue