Show More
@@ -3079,6 +3079,7 b' class UserGroupRepoToPerm(Base, BaseMode' | |||
|
3079 | 3079 | users_group = relationship('UserGroup') |
|
3080 | 3080 | permission = relationship('Permission') |
|
3081 | 3081 | repository = relationship('Repository') |
|
3082 | user_group_branch_perms = relationship('UserGroupToRepoBranchPermission', cascade='all') | |
|
3082 | 3083 | |
|
3083 | 3084 | @classmethod |
|
3084 | 3085 | def create(cls, users_group, repository, permission): |
@@ -73,9 +73,10 b'' | |||
|
73 | 73 | </td> |
|
74 | 74 | </tr> |
|
75 | 75 | %else: |
|
76 | <% used_by_n_rules = len(getattr(_user, 'branch_rules', None) or []) %> | |
|
76 | 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.read', checked=_user.permission=='repository.read')}</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> | |
|
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 | 80 | <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.write', checked=_user.permission=='repository.write')}</td> |
|
80 | 81 | <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.admin', checked=_user.permission=='repository.admin')}</td> |
|
81 | 82 | <td class="td-user"> |
@@ -89,11 +90,10 b'' | |||
|
89 | 90 | (${_('inactive duplicate')}) |
|
90 | 91 | %endif |
|
91 | 92 | %if getattr(_user, 'branch_rules', None): |
|
92 | <% used_by_n_rules = len(_user.branch_rules) %> | |
|
93 | 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 | 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 | 97 | % endif |
|
98 | 98 | %endif |
|
99 | 99 | % endif |
General Comments 0
You need to be logged in to leave comments.
Login now