mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Let's convert this in list in all cases (+ simplify later core)
This commit is contained in:
parent
32b6c2eccf
commit
9697ca8e4b
1 changed files with 5 additions and 6 deletions
|
@ -261,15 +261,14 @@ def permission_create(operation_logger, permission, url=None, allowed=None, sync
|
|||
attr_dict['URL'] = url
|
||||
|
||||
if allowed is not None:
|
||||
if not isinstance(allowed, list):
|
||||
allowed = [allowed]
|
||||
if "visitors" in allowed and "all_users" not in allowed:
|
||||
if not isinstance(allowed, list):
|
||||
allowed = [allowed]
|
||||
allowed.append("all_users")
|
||||
|
||||
# Validate that the groups to add actually exist
|
||||
all_existing_groups = user_group_list()['groups'].keys()
|
||||
allowed_ = [] if allowed is None else [allowed] if not isinstance(allowed, list) else allowed
|
||||
for group in allowed_:
|
||||
for group in allowed or []:
|
||||
if group not in all_existing_groups:
|
||||
raise YunohostError('group_unknown', group=group)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue