##// END OF EJS Templates
branch-permissions: handle cases for revoking regular permissions when branch permissions are set:...
marcink -
r2984:de0780ef default
parent child Browse files
Show More
@@ -3079,6 +3079,7 b' class UserGroupRepoToPerm(Base, BaseMode'
3079 users_group = relationship('UserGroup')
3079 users_group = relationship('UserGroup')
3080 permission = relationship('Permission')
3080 permission = relationship('Permission')
3081 repository = relationship('Repository')
3081 repository = relationship('Repository')
3082 user_group_branch_perms = relationship('UserGroupToRepoBranchPermission', cascade='all')
3082
3083
3083 @classmethod
3084 @classmethod
3084 def create(cls, users_group, repository, permission):
3085 def create(cls, users_group, repository, permission):
@@ -73,9 +73,10 b''
73 </td>
73 </td>
74 </tr>
74 </tr>
75 %else:
75 %else:
76 <% used_by_n_rules = len(getattr(_user, 'branch_rules', None) or []) %>
76 <tr>
77 <tr>
77 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.none', checked=_user.permission=='repository.none')}</td>
78 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.none', checked=_user.permission=='repository.none', disabled="disabled" if (used_by_n_rules and _user.username != h.DEFAULT_USER) else None)}</td>
78 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.read', checked=_user.permission=='repository.read')}</td>
79 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.read', checked=_user.permission=='repository.read', disabled="disabled" if (used_by_n_rules and _user.username != h.DEFAULT_USER) else None)}</td>
79 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.write', checked=_user.permission=='repository.write')}</td>
80 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.write', checked=_user.permission=='repository.write')}</td>
80 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.admin', checked=_user.permission=='repository.admin')}</td>
81 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.admin', checked=_user.permission=='repository.admin')}</td>
81 <td class="td-user">
82 <td class="td-user">
@@ -89,11 +90,10 b''
89 (${_('inactive duplicate')})
90 (${_('inactive duplicate')})
90 %endif
91 %endif
91 %if getattr(_user, 'branch_rules', None):
92 %if getattr(_user, 'branch_rules', None):
92 <% used_by_n_rules = len(_user.branch_rules) %>
93 % if used_by_n_rules == 1:
93 % if used_by_n_rules == 1:
94 (${_('used by {} branch rule').format(used_by_n_rules)})
94 (${_('used by {} branch rule, requires write+ permissions').format(used_by_n_rules)})
95 % else:
95 % else:
96 (${_('used by {} branch rules').format(used_by_n_rules)})
96 (${_('used by {} branch rules, requires write+ permissions').format(used_by_n_rules)})
97 % endif
97 % endif
98 %endif
98 %endif
99 % endif
99 % endif
General Comments 0
You need to be logged in to leave comments. Login now