mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
symplify premission_create
This commit is contained in:
parent
a719ab05a2
commit
1b8e528965
1 changed files with 1 additions and 10 deletions
|
@ -267,16 +267,7 @@ def permission_create(operation_logger, permission, url=None, allowed=None, sync
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise YunohostError('permission_creation_failed', permission=permission, error=e)
|
raise YunohostError('permission_creation_failed', permission=permission, error=e)
|
||||||
|
|
||||||
to_add = None
|
new_permission = _update_ldap_group_permission(permission=permission, allowed=allowed, sync_perm=sync_perm)
|
||||||
|
|
||||||
# If who should be allowed is explicitly provided, use this info
|
|
||||||
if allowed:
|
|
||||||
if not isinstance(allowed, list):
|
|
||||||
to_add = [allowed]
|
|
||||||
else:
|
|
||||||
to_add = allowed
|
|
||||||
|
|
||||||
new_permission = _update_ldap_group_permission(permission=permission, allowed=to_add, sync_perm=sync_perm)
|
|
||||||
|
|
||||||
logger.debug(m18n.n('permission_created', permission=permission))
|
logger.debug(m18n.n('permission_created', permission=permission))
|
||||||
return new_permission
|
return new_permission
|
||||||
|
|
Loading…
Add table
Reference in a new issue