##// END OF EJS Templates
permissions: fix problem with permissions reset to None for cases when user...
marcink -
r2505:a371cd7f default
parent child Browse files
Show More
@@ -791,20 +791,22 b" def ValidPerms(localizer, type_='repo'):"
791 # get updates of permissions
791 # get updates of permissions
792 # (read the existing radio button states)
792 # (read the existing radio button states)
793 default_user_id = User.get_default_user().user_id
793 default_user_id = User.get_default_user().user_id
794
794 for k, update_value in value.iteritems():
795 for k, update_value in value.iteritems():
795 if k.startswith('u_perm_') or k.startswith('g_perm_'):
796 if k.startswith('u_perm_') or k.startswith('g_perm_'):
796 member = k[7:]
797 obj_type = k[0]
798 obj_id = k[7:]
797 update_type = {'u': 'user',
799 update_type = {'u': 'user',
798 'g': 'users_group'}[k[0]]
800 'g': 'users_group'}[obj_type]
799
801
800 if safe_int(member) == default_user_id:
802 if obj_type == 'u' and safe_int(obj_id) == default_user_id:
801 if str2bool(value.get('repo_private')):
803 if str2bool(value.get('repo_private')):
802 # prevent from updating default user permissions
804 # prevent from updating default user permissions
803 # when this repository is marked as private
805 # when this repository is marked as private
804 update_value = EMPTY_PERM
806 update_value = EMPTY_PERM
805
807
806 perm_updates.add(
808 perm_updates.add(
807 (member, update_value, update_type))
809 (obj_id, update_value, update_type))
808
810
809 value['perm_additions'] = [] # propagated later
811 value['perm_additions'] = [] # propagated later
810 value['perm_updates'] = list(perm_updates)
812 value['perm_updates'] = list(perm_updates)
General Comments 0
You need to be logged in to leave comments. Login now