mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Wokay, getting tired of breaking the entire permission/group ecosystem because of bugs when developing.
This commit is contained in:
parent
2617fd2487
commit
c315df9269
2 changed files with 9 additions and 1 deletions
|
@ -433,6 +433,9 @@ def app_map(app=None, raw=False, user=None):
|
||||||
continue
|
continue
|
||||||
# Users must at least have access to the main permission to have access to extra permissions
|
# Users must at least have access to the main permission to have access to extra permissions
|
||||||
if user:
|
if user:
|
||||||
|
if not app_id + ".main" in permissions:
|
||||||
|
logger.warning("Uhoh, no main permission was found for app %s ... sounds like an app was only partially removed due to another bug :/" % app_id)
|
||||||
|
continue
|
||||||
main_perm = permissions[app_id + ".main"]
|
main_perm = permissions[app_id + ".main"]
|
||||||
if user not in main_perm["corresponding_users"] and "visitors" not in main_perm["allowed"]:
|
if user not in main_perm["corresponding_users"] and "visitors" not in main_perm["allowed"]:
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -268,7 +268,12 @@ def user_delete(operation_logger, username, purge=False):
|
||||||
# remove the member from the group
|
# remove the member from the group
|
||||||
if username != group and username in infos["members"]:
|
if username != group and username in infos["members"]:
|
||||||
user_group_update(group, remove=username, sync_perm=False)
|
user_group_update(group, remove=username, sync_perm=False)
|
||||||
user_group_delete(username, force=True, sync_perm=True)
|
|
||||||
|
# Delete primary group if it exists (why wouldnt it exists ? because some
|
||||||
|
# epic bug happened somewhere else and only a partial removal was
|
||||||
|
# performed...)
|
||||||
|
if username in user_group_list()['groups'].keys():
|
||||||
|
user_group_delete(username, force=True, sync_perm=True)
|
||||||
|
|
||||||
ldap = _get_ldap_interface()
|
ldap = _get_ldap_interface()
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Reference in a new issue