Show More
The requested changes are too big and content was truncated. Show full diff
|
1 | NO CONTENT: modified file | |
The requested commit or file is too big and content was truncated. Show full diff |
@@ -1,164 +1,172 b'' | |||
|
1 | 1 | <%namespace name="base" file="/base/base.mako"/> |
|
2 | 2 | |
|
3 | 3 | <div class="panel panel-default"> |
|
4 | 4 | <div class="panel-heading"> |
|
5 | 5 | <h3 class="panel-title">${_('Repository Permissions')}</h3> |
|
6 | 6 | </div> |
|
7 | 7 | <div class="panel-body"> |
|
8 | 8 | ${h.secure_form(h.route_path('edit_repo_perms', repo_name=c.repo_name), request=request)} |
|
9 | 9 | <table id="permissions_manage" class="rctable permissions"> |
|
10 | 10 | <tr> |
|
11 | 11 | <th class="td-radio">${_('None')}</th> |
|
12 | 12 | <th class="td-radio">${_('Read')}</th> |
|
13 | 13 | <th class="td-radio">${_('Write')}</th> |
|
14 | 14 | <th class="td-radio">${_('Admin')}</th> |
|
15 | 15 | <th class="td-owner">${_('User/User Group')}</th> |
|
16 | 16 | <th></th> |
|
17 | 17 | <th></th> |
|
18 | 18 | </tr> |
|
19 | 19 | ## USERS |
|
20 | 20 | %for _user in c.rhodecode_db_repo.permissions(): |
|
21 | 21 | %if getattr(_user, 'admin_row', None) or getattr(_user, 'owner_row', None): |
|
22 | 22 | <tr class="perm_admin_row"> |
|
23 | 23 | <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.none', disabled="disabled")}</td> |
|
24 | 24 | <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.read', disabled="disabled")}</td> |
|
25 | 25 | <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.write', disabled="disabled")}</td> |
|
26 | 26 | <td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.admin', 'repository.admin', disabled="disabled")}</td> |
|
27 | 27 | <td class="td-user"> |
|
28 | 28 | ${base.gravatar(_user.email, 16)} |
|
29 | 29 | ${h.link_to_user(_user.username)} |
|
30 | 30 | %if getattr(_user, 'admin_row', None): |
|
31 | 31 | (${_('super admin')}) |
|
32 | 32 | %endif |
|
33 | 33 | %if getattr(_user, 'owner_row', None): |
|
34 | 34 | (${_('owner')}) |
|
35 | 35 | %endif |
|
36 | 36 | </td> |
|
37 | 37 | <td></td> |
|
38 | 38 | <td> |
|
39 | 39 | % if c.rhodecode_user.is_admin: |
|
40 | 40 | ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-permissions'))} |
|
41 | 41 | % endif |
|
42 | 42 | </td> |
|
43 | 43 | </tr> |
|
44 | 44 | %elif _user.username == h.DEFAULT_USER and c.rhodecode_db_repo.private: |
|
45 | 45 | <tr> |
|
46 | 46 | <td colspan="4"> |
|
47 | 47 | <span class="private_repo_msg"> |
|
48 | 48 | <strong title="${h.tooltip(_user.permission)}">${_('private repository')}</strong> |
|
49 | 49 | </span> |
|
50 | 50 | </td> |
|
51 | 51 | <td class="private_repo_msg"> |
|
52 | 52 | ${base.gravatar(h.DEFAULT_USER_EMAIL, 16)} |
|
53 | 53 | ${h.DEFAULT_USER} - ${_('only users/user groups explicitly added here will have access')}</td> |
|
54 | 54 | <td></td> |
|
55 | 55 | <td> |
|
56 | 56 | % if c.rhodecode_user.is_admin: |
|
57 | 57 | ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-permissions'))} |
|
58 | 58 | % endif |
|
59 | 59 | </td> |
|
60 | 60 | </tr> |
|
61 | 61 | %else: |
|
62 | 62 | <tr> |
|
63 | 63 | <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.none', checked=_user.permission=='repository.none')}</td> |
|
64 | 64 | <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.read', checked=_user.permission=='repository.read')}</td> |
|
65 | 65 | <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.write', checked=_user.permission=='repository.write')}</td> |
|
66 | 66 | <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'repository.admin', checked=_user.permission=='repository.admin')}</td> |
|
67 | 67 | <td class="td-user"> |
|
68 | 68 | ${base.gravatar(_user.email, 16)} |
|
69 | 69 | <span class="user"> |
|
70 | 70 | % if _user.username == h.DEFAULT_USER: |
|
71 | 71 | ${h.DEFAULT_USER} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span> |
|
72 | 72 | % else: |
|
73 | 73 | ${h.link_to_user(_user.username)} |
|
74 | 74 | %if getattr(_user, 'duplicate_perm', None): |
|
75 | 75 | (${_('inactive duplicate')}) |
|
76 | 76 | %endif |
|
77 | %if getattr(_user, 'branch_rules', None): | |
|
78 | <% used_by_n_rules = len(_user.branch_rules) %> | |
|
79 | % if used_by_n_rules == 1: | |
|
80 | (${_('used by {} branch rule').format(used_by_n_rules)}) | |
|
81 | % else: | |
|
82 | (${_('used by {} branch rules').format(used_by_n_rules)}) | |
|
83 | % endif | |
|
84 | %endif | |
|
77 | 85 | % endif |
|
78 | 86 | </span> |
|
79 | 87 | </td> |
|
80 | 88 | <td class="td-action"> |
|
81 | %if _user.username != h.DEFAULT_USER: | |
|
89 | %if _user.username != h.DEFAULT_USER and getattr(_user, 'branch_rules', None) is None: | |
|
82 | 90 | <span class="btn btn-link btn-danger revoke_perm" |
|
83 | 91 | member="${_user.user_id}" member_type="user"> |
|
84 | 92 | ${_('Revoke')} |
|
85 | 93 | </span> |
|
86 | 94 | %endif |
|
87 | 95 | </td> |
|
88 | 96 | <td> |
|
89 | 97 | % if c.rhodecode_user.is_admin: |
|
90 | 98 | % if _user.username == h.DEFAULT_USER: |
|
91 | 99 | ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-permissions'))} |
|
92 | 100 | % else: |
|
93 | 101 | ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-permissions'))} |
|
94 | 102 | % endif |
|
95 | 103 | % endif |
|
96 | 104 | </td> |
|
97 | 105 | </tr> |
|
98 | 106 | %endif |
|
99 | 107 | %endfor |
|
100 | 108 | |
|
101 | 109 | ## USER GROUPS |
|
102 | 110 | %for _user_group in c.rhodecode_db_repo.permission_user_groups(): |
|
103 | 111 | <tr> |
|
104 | 112 | <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.none', checked=_user_group.permission=='repository.none')}</td> |
|
105 | 113 | <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.read', checked=_user_group.permission=='repository.read')}</td> |
|
106 | 114 | <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.write', checked=_user_group.permission=='repository.write')}</td> |
|
107 | 115 | <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.admin', checked=_user_group.permission=='repository.admin')}</td> |
|
108 | 116 | <td class="td-componentname"> |
|
109 | 117 | <i class="icon-user-group"></i> |
|
110 | 118 | %if h.HasPermissionAny('hg.admin')(): |
|
111 | 119 | <a href="${h.route_path('edit_user_group',user_group_id=_user_group.users_group_id)}"> |
|
112 | 120 | ${_user_group.users_group_name} |
|
113 | 121 | </a> |
|
114 | 122 | %else: |
|
115 | 123 | ${h.link_to_group(_user_group.users_group_name)} |
|
116 | 124 | %endif |
|
117 | 125 | </td> |
|
118 | 126 | <td class="td-action"> |
|
119 | 127 | <span class="btn btn-link btn-danger revoke_perm" |
|
120 | 128 | member="${_user_group.users_group_id}" member_type="user_group"> |
|
121 | 129 | ${_('Revoke')} |
|
122 | 130 | </span> |
|
123 | 131 | </td> |
|
124 | 132 | <td> |
|
125 | 133 | % if c.rhodecode_user.is_admin: |
|
126 | 134 | ${h.link_to('show permissions', h.route_path('edit_user_group_perms_summary', user_group_id=_user_group.users_group_id, _anchor='repositories-permissions'))} |
|
127 | 135 | % endif |
|
128 | 136 | </td> |
|
129 | 137 | </tr> |
|
130 | 138 | %endfor |
|
131 | 139 | <tr class="new_members" id="add_perm_input"></tr> |
|
132 | 140 | |
|
133 | 141 | <tr> |
|
134 | 142 | <td></td> |
|
135 | 143 | <td></td> |
|
136 | 144 | <td></td> |
|
137 | 145 | <td></td> |
|
138 | 146 | <td></td> |
|
139 | 147 | <td> |
|
140 | 148 | <span id="add_perm" class="link"> |
|
141 | 149 | ${_('Add user/user group')} |
|
142 | 150 | </span> |
|
143 | 151 | </td> |
|
144 | 152 | <td></td> |
|
145 | 153 | </tr> |
|
146 | 154 | |
|
147 | 155 | </table> |
|
148 | 156 | |
|
149 | 157 | <div class="buttons"> |
|
150 | 158 | ${h.submit('save',_('Save'),class_="btn btn-primary")} |
|
151 | 159 | ${h.reset('reset',_('Reset'),class_="btn btn-danger")} |
|
152 | 160 | </div> |
|
153 | 161 | ${h.end_form()} |
|
154 | 162 | </div> |
|
155 | 163 | </div> |
|
156 | 164 | |
|
157 | 165 | <script type="text/javascript"> |
|
158 | 166 | $('#add_perm').on('click', function(e){ |
|
159 | 167 | addNewPermInput($(this), 'repository'); |
|
160 | 168 | }); |
|
161 | 169 | $('.revoke_perm').on('click', function(e){ |
|
162 | 170 | markRevokePermInput($(this), 'repository'); |
|
163 | 171 | }); |
|
164 | 172 | </script> |
General Comments 0
You need to be logged in to leave comments.
Login now