##// END OF EJS Templates
perms: updated perms summary for users...
marcink -
r2011:72acb5fb default
parent child Browse files
Show More
@@ -41,7 +41,7 b''
41 41 <tr>
42 42 <th colspan="2" class="left">${_('Permission')}</th>
43 43 %if actions:
44 <th>${_('Edit Permission')}</th>
44 <th colspan="2">${_('Edit Permission')}</th>
45 45 %endif
46 46 </thead>
47 47 <tbody>
@@ -56,7 +56,8 b''
56 56 _selected_vals = [x.partition(prefix)[-1] for x in _selected]
57 57 return admin, _selected_vals, _selected
58 58 %>
59 <%def name="glob(lbl, val, val_lbl=None, custom_url=None)">
59
60 <%def name="glob(lbl, val, val_lbl=None, edit_url=None, edit_global_url=None)">
60 61 <tr>
61 62 <td class="td-tags">
62 63 ${lbl}
@@ -64,7 +65,8 b''
64 65 <td class="td-tags">
65 66 %if val[0]:
66 67 %if not val_lbl:
67 ${h.bool2icon(True)}
68 ## super admin case
69 True
68 70 %else:
69 71 <span class="perm_tag admin">${val_lbl}.admin</span>
70 72 %endif
@@ -82,24 +84,62 b''
82 84 %endif
83 85 </td>
84 86 %if actions:
85 <td class="td-action">
86 <a href="${custom_url or h.route_path('admin_permissions_global')}">${_('edit')}</a>
87 </td>
87
88 % if edit_url or edit_global_url:
89
90 <td class="td-action">
91 % if edit_url:
92 <a href="${edit_url}">${_('edit')}</a>
93 % else:
94 -
95 % endif
96 </td>
97
98 <td class="td-action">
99 % if edit_global_url:
100 <a href="${edit_global_url}">${_('edit global')}</a>
101 % else:
102 -
103 % endif
104 </td>
105
106 % else:
107 <td class="td-action"></td>
108 <td class="td-action">
109 <a href="${h.route_path('admin_permissions_global')}">${_('edit global')}</a>
110 <td class="td-action">
111 % endif
112
88 113 %endif
89 114 </tr>
90 115 </%def>
91 116
92 ${glob(_('Super admin'), get_section_perms('hg.admin', permissions[section]))}
117 ${glob(_('Repository default permission'), get_section_perms('repository.', permissions[section]), 'repository',
118 edit_url=None, edit_global_url=h.route_path('admin_permissions_object'))}
119
120 ${glob(_('Repository group default permission'), get_section_perms('group.', permissions[section]), 'group',
121 edit_url=None, edit_global_url=h.route_path('admin_permissions_object'))}
93 122
94 ${glob(_('Repository default permission'), get_section_perms('repository.', permissions[section]), 'repository', h.route_path('admin_permissions_object'))}
95 ${glob(_('Repository group default permission'), get_section_perms('group.', permissions[section]), 'group', h.route_path('admin_permissions_object'))}
96 ${glob(_('User group default permission'), get_section_perms('usergroup.', permissions[section]), 'usergroup', h.route_path('admin_permissions_object'))}
123 ${glob(_('User group default permission'), get_section_perms('usergroup.', permissions[section]), 'usergroup',
124 edit_url=None, edit_global_url=h.route_path('admin_permissions_object'))}
125
126 ${glob(_('Super admin'), get_section_perms('hg.admin', permissions[section]),
127 edit_url=h.url('edit_user', user_id=c.user.user_id, anchor='admin'), edit_global_url=None)}
97 128
98 ${glob(_('Create repositories'), get_section_perms('hg.create.', permissions[section]), custom_url=h.route_path('admin_permissions_global'))}
99 ${glob(_('Fork repositories'), get_section_perms('hg.fork.', permissions[section]), custom_url=h.route_path('admin_permissions_global'))}
100 ${glob(_('Create repository groups'), get_section_perms('hg.repogroup.create.', permissions[section]), custom_url=h.route_path('admin_permissions_global'))}
101 ${glob(_('Create user groups'), get_section_perms('hg.usergroup.create.', permissions[section]), custom_url=h.route_path('admin_permissions_global'))}
129 ${glob(_('Inherit permissions'), get_section_perms('hg.inherit_default_perms.', permissions[section]),
130 edit_url=h.url('edit_user_global_perms', user_id=c.user.user_id), edit_global_url=None)}
131
132 ${glob(_('Create repositories'), get_section_perms('hg.create.', permissions[section]),
133 edit_url=h.url('edit_user_global_perms', user_id=c.user.user_id), edit_global_url=h.route_path('admin_permissions_object'))}
102 134
135 ${glob(_('Fork repositories'), get_section_perms('hg.fork.', permissions[section]),
136 edit_url=h.url('edit_user_global_perms', user_id=c.user.user_id), edit_global_url=h.route_path('admin_permissions_object'))}
137
138 ${glob(_('Create repository groups'), get_section_perms('hg.repogroup.create.', permissions[section]),
139 edit_url=h.url('edit_user_global_perms', user_id=c.user.user_id), edit_global_url=h.route_path('admin_permissions_object'))}
140
141 ${glob(_('Create user groups'), get_section_perms('hg.usergroup.create.', permissions[section]),
142 edit_url=h.url('edit_user_global_perms', user_id=c.user.user_id), edit_global_url=h.route_path('admin_permissions_object'))}
103 143
104 144 </tbody>
105 145 %else:
General Comments 0
You need to be logged in to leave comments. Login now