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,201 +1,201 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 class="td-action"></th> |
|
17 | 17 | <th class="td-action"></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 class="quick_repo_menu"> |
|
39 | 39 | % if c.rhodecode_user.is_admin: |
|
40 | 40 | <i class="icon-more"></i> |
|
41 | 41 | <div class="menu_items_container" style="display: none;"> |
|
42 | 42 | <ul class="menu_items"> |
|
43 | 43 | <li> |
|
44 | 44 | ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-permissions'))} |
|
45 | 45 | </li> |
|
46 | 46 | </ul> |
|
47 | 47 | </div> |
|
48 | 48 | % endif |
|
49 | 49 | </td> |
|
50 | 50 | </tr> |
|
51 | 51 | %elif _user.username == h.DEFAULT_USER and c.rhodecode_db_repo.private: |
|
52 | 52 | <tr> |
|
53 | 53 | <td colspan="4"> |
|
54 | 54 | <span class="private_repo_msg"> |
|
55 | 55 | <strong title="${h.tooltip(_user.permission)}">${_('private repository')}</strong> |
|
56 | 56 | </span> |
|
57 | 57 | </td> |
|
58 | 58 | <td class="private_repo_msg"> |
|
59 | 59 | ${base.gravatar(h.DEFAULT_USER_EMAIL, 16)} |
|
60 | 60 | ${h.DEFAULT_USER} - ${_('only users/user groups explicitly added here will have access')}</td> |
|
61 | 61 | <td></td> |
|
62 | 62 | <td class="quick_repo_menu"> |
|
63 | 63 | % if c.rhodecode_user.is_admin: |
|
64 | 64 | <i class="icon-more"></i> |
|
65 | 65 | <div class="menu_items_container" style="display: none;"> |
|
66 | 66 | <ul class="menu_items"> |
|
67 | 67 | <li> |
|
68 | 68 | ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-permissions'))} |
|
69 | 69 | </li> |
|
70 | 70 | </ul> |
|
71 | 71 | </div> |
|
72 | 72 | % endif |
|
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"> |
|
82 | 83 | ${base.gravatar(_user.email, 16)} |
|
83 | 84 | <span class="user"> |
|
84 | 85 | % if _user.username == h.DEFAULT_USER: |
|
85 | 86 | ${h.DEFAULT_USER} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span> |
|
86 | 87 | % else: |
|
87 | 88 | ${h.link_to_user(_user.username)} |
|
88 | 89 | %if getattr(_user, 'duplicate_perm', None): |
|
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 |
|
100 | 100 | </span> |
|
101 | 101 | </td> |
|
102 | 102 | <td class="td-action"> |
|
103 | 103 | %if _user.username != h.DEFAULT_USER and getattr(_user, 'branch_rules', None) is None: |
|
104 | 104 | <span class="btn btn-link btn-danger revoke_perm" |
|
105 | 105 | member="${_user.user_id}" member_type="user"> |
|
106 | 106 | ${_('Remove')} |
|
107 | 107 | </span> |
|
108 | 108 | %endif |
|
109 | 109 | </td> |
|
110 | 110 | <td class="quick_repo_menu"> |
|
111 | 111 | % if c.rhodecode_user.is_admin: |
|
112 | 112 | <i class="icon-more"></i> |
|
113 | 113 | <div class="menu_items_container" style="display: none;"> |
|
114 | 114 | <ul class="menu_items"> |
|
115 | 115 | <li> |
|
116 | 116 | % if _user.username == h.DEFAULT_USER: |
|
117 | 117 | ${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-permissions'))} |
|
118 | 118 | % else: |
|
119 | 119 | ${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-permissions'))} |
|
120 | 120 | % endif |
|
121 | 121 | </li> |
|
122 | 122 | </ul> |
|
123 | 123 | </div> |
|
124 | 124 | % endif |
|
125 | 125 | </td> |
|
126 | 126 | </tr> |
|
127 | 127 | %endif |
|
128 | 128 | %endfor |
|
129 | 129 | |
|
130 | 130 | ## USER GROUPS |
|
131 | 131 | %for _user_group in c.rhodecode_db_repo.permission_user_groups(): |
|
132 | 132 | <tr> |
|
133 | 133 | <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.none', checked=_user_group.permission=='repository.none')}</td> |
|
134 | 134 | <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.read', checked=_user_group.permission=='repository.read')}</td> |
|
135 | 135 | <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.write', checked=_user_group.permission=='repository.write')}</td> |
|
136 | 136 | <td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'repository.admin', checked=_user_group.permission=='repository.admin')}</td> |
|
137 | 137 | <td class="td-componentname"> |
|
138 | 138 | <i class="icon-user-group"></i> |
|
139 | 139 | %if h.HasPermissionAny('hg.admin')(): |
|
140 | 140 | <a href="${h.route_path('edit_user_group',user_group_id=_user_group.users_group_id)}"> |
|
141 | 141 | ${_user_group.users_group_name} |
|
142 | 142 | </a> |
|
143 | 143 | %else: |
|
144 | 144 | ${h.link_to_group(_user_group.users_group_name)} |
|
145 | 145 | %endif |
|
146 | 146 | </td> |
|
147 | 147 | <td class="td-action"> |
|
148 | 148 | <span class="btn btn-link btn-danger revoke_perm" |
|
149 | 149 | member="${_user_group.users_group_id}" member_type="user_group"> |
|
150 | 150 | ${_('Remove')} |
|
151 | 151 | </span> |
|
152 | 152 | </td> |
|
153 | 153 | <td class="quick_repo_menu"> |
|
154 | 154 | % if c.rhodecode_user.is_admin: |
|
155 | 155 | <i class="icon-more"></i> |
|
156 | 156 | <div class="menu_items_container" style="display: none;"> |
|
157 | 157 | <ul class="menu_items"> |
|
158 | 158 | <li> |
|
159 | 159 | ${h.link_to('show permissions', h.route_path('edit_user_group_perms_summary', user_group_id=_user_group.users_group_id, _anchor='repositories-permissions'))} |
|
160 | 160 | </li> |
|
161 | 161 | </ul> |
|
162 | 162 | </div> |
|
163 | 163 | % endif |
|
164 | 164 | </td> |
|
165 | 165 | </tr> |
|
166 | 166 | %endfor |
|
167 | 167 | <tr class="new_members" id="add_perm_input"></tr> |
|
168 | 168 | |
|
169 | 169 | <tr> |
|
170 | 170 | <td></td> |
|
171 | 171 | <td></td> |
|
172 | 172 | <td></td> |
|
173 | 173 | <td></td> |
|
174 | 174 | <td></td> |
|
175 | 175 | <td> |
|
176 | 176 | <span id="add_perm" class="link"> |
|
177 | 177 | ${_('Add user/user group')} |
|
178 | 178 | </span> |
|
179 | 179 | </td> |
|
180 | 180 | <td></td> |
|
181 | 181 | </tr> |
|
182 | 182 | |
|
183 | 183 | </table> |
|
184 | 184 | |
|
185 | 185 | <div class="buttons"> |
|
186 | 186 | ${h.submit('save',_('Save'),class_="btn btn-primary")} |
|
187 | 187 | ${h.reset('reset',_('Reset'),class_="btn btn-danger")} |
|
188 | 188 | </div> |
|
189 | 189 | ${h.end_form()} |
|
190 | 190 | </div> |
|
191 | 191 | </div> |
|
192 | 192 | |
|
193 | 193 | <script type="text/javascript"> |
|
194 | 194 | $('#add_perm').on('click', function(e){ |
|
195 | 195 | addNewPermInput($(this), 'repository'); |
|
196 | 196 | }); |
|
197 | 197 | $('.revoke_perm').on('click', function(e){ |
|
198 | 198 | markRevokePermInput($(this), 'repository'); |
|
199 | 199 | }); |
|
200 | 200 | quick_repo_menu(); |
|
201 | 201 | </script> |
General Comments 0
You need to be logged in to leave comments.
Login now