Show More
@@ -211,11 +211,6 class ReposGroupsController(BaseControll | |||||
211 | )() |
|
211 | )() | |
212 | try: |
|
212 | try: | |
213 | form_result = repos_group_form.to_python(dict(request.POST)) |
|
213 | form_result = repos_group_form.to_python(dict(request.POST)) | |
214 | if not c.rhodecode_user.is_admin: |
|
|||
215 | if self._revoke_perms_on_yourself(form_result): |
|
|||
216 | msg = _('Cannot revoke permission for yourself as admin') |
|
|||
217 | h.flash(msg, category='warning') |
|
|||
218 | raise Exception('revoke admin permission on self') |
|
|||
219 |
|
214 | |||
220 | new_gr = ReposGroupModel().update(group_name, form_result) |
|
215 | new_gr = ReposGroupModel().update(group_name, form_result) | |
221 | Session().commit() |
|
216 | Session().commit() | |
@@ -278,14 +273,20 class ReposGroupsController(BaseControll | |||||
278 | @HasReposGroupPermissionAnyDecorator('group.admin') |
|
273 | @HasReposGroupPermissionAnyDecorator('group.admin') | |
279 | def set_repo_group_perm_member(self, group_name): |
|
274 | def set_repo_group_perm_member(self, group_name): | |
280 | c.repos_group = ReposGroupModel()._get_repo_group(group_name) |
|
275 | c.repos_group = ReposGroupModel()._get_repo_group(group_name) | |
281 | form = RepoGroupPermsForm()().to_python(request.POST) |
|
276 | form_result = RepoGroupPermsForm()().to_python(request.POST) | |
282 |
|
277 | if not c.rhodecode_user.is_admin: | ||
283 | recursive = form['recursive'] |
|
278 | if self._revoke_perms_on_yourself(form_result): | |
|
279 | msg = _('Cannot revoke permission for yourself as admin') | |||
|
280 | h.flash(msg, category='warning') | |||
|
281 | return redirect(url('edit_repos_group', group_name=group_name)) | |||
|
282 | recursive = form_result['recursive'] | |||
284 | # iterate over all members(if in recursive mode) of this groups and |
|
283 | # iterate over all members(if in recursive mode) of this groups and | |
285 | # set the permissions ! |
|
284 | # set the permissions ! | |
286 | # this can be potentially heavy operation |
|
285 | # this can be potentially heavy operation | |
287 |
ReposGroupModel()._update_permissions(c.repos_group, |
|
286 | ReposGroupModel()._update_permissions(c.repos_group, | |
288 |
form['perms_ |
|
287 | form_result['perms_new'], | |
|
288 | form_result['perms_updates'], | |||
|
289 | recursive) | |||
289 | #TODO: implement this |
|
290 | #TODO: implement this | |
290 | #action_logger(self.rhodecode_user, 'admin_changed_repo_permissions', |
|
291 | #action_logger(self.rhodecode_user, 'admin_changed_repo_permissions', | |
291 | # repo_name, self.ip_addr, self.sa) |
|
292 | # repo_name, self.ip_addr, self.sa) |
General Comments 0
You need to be logged in to leave comments.
Login now