mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[Fix] permission create
This commit is contained in:
parent
67816ad18e
commit
a959a97e8c
1 changed files with 6 additions and 3 deletions
|
@ -273,9 +273,8 @@ def permission_create(operation_logger, permission, url=None, allowed=None, sync
|
||||||
if allowed:
|
if allowed:
|
||||||
if not isinstance(allowed, list):
|
if not isinstance(allowed, list):
|
||||||
to_add = [allowed]
|
to_add = [allowed]
|
||||||
# For main permission, we add all users by default
|
else:
|
||||||
elif permission.endswith(".main"):
|
to_add = allowed
|
||||||
to_add = "all_users"
|
|
||||||
|
|
||||||
new_permission = _update_ldap_group_permission(permission=permission, allowed=to_add, sync_perm=sync_perm)
|
new_permission = _update_ldap_group_permission(permission=permission, allowed=to_add, sync_perm=sync_perm)
|
||||||
|
|
||||||
|
@ -295,6 +294,10 @@ def permission_url(operation_logger, permission, url=None, sync_perm=True):
|
||||||
from yunohost.utils.ldap import _get_ldap_interface
|
from yunohost.utils.ldap import _get_ldap_interface
|
||||||
ldap = _get_ldap_interface()
|
ldap = _get_ldap_interface()
|
||||||
|
|
||||||
|
# By default, manipulate main permission
|
||||||
|
if "." not in permission:
|
||||||
|
permission = permission + ".main"
|
||||||
|
|
||||||
# Fetch existing permission
|
# Fetch existing permission
|
||||||
|
|
||||||
existing_permission = user_permission_list(full=True)["permissions"].get(permission, None)
|
existing_permission = user_permission_list(full=True)["permissions"].get(permission, None)
|
||||||
|
|
Loading…
Add table
Reference in a new issue