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