diff --git a/docs/changelog.rst b/docs/changelog.rst --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -31,6 +31,7 @@ news reformated based on user suggestions. Additional rss/atom feeds for user journal - various i18n improvements +- #478 permissions overview for admin in user edit view fixes +++++ diff --git a/rhodecode/controllers/admin/users.py b/rhodecode/controllers/admin/users.py --- a/rhodecode/controllers/admin/users.py +++ b/rhodecode/controllers/admin/users.py @@ -35,7 +35,8 @@ from pylons.i18n.translation import _ from rhodecode.lib.exceptions import DefaultUserException, \ UserOwnsReposException from rhodecode.lib import helpers as h -from rhodecode.lib.auth import LoginRequired, HasPermissionAllDecorator +from rhodecode.lib.auth import LoginRequired, HasPermissionAllDecorator,\ + AuthUser from rhodecode.lib.base import BaseController, render from rhodecode.model.db import User, Permission, UserEmailMap @@ -111,7 +112,7 @@ class UsersController(BaseController): # url('user', id=ID) user_model = UserModel() c.user = user_model.get(id) - + c.perm_user = AuthUser(user_id=id) _form = UserForm(edit=True, old_data={'user_id': id, 'email': c.user.email})() form_result = {} @@ -174,6 +175,7 @@ class UsersController(BaseController): if c.user.username == 'default': h.flash(_("You can't edit this user"), category='warning') return redirect(url('users')) + c.perm_user = AuthUser(user_id=id) c.user.permissions = {} c.granted_permissions = UserModel().fill_perms(c.user)\ .permissions['global'] diff --git a/rhodecode/templates/admin/users/user_edit.html b/rhodecode/templates/admin/users/user_edit.html --- a/rhodecode/templates/admin/users/user_edit.html +++ b/rhodecode/templates/admin/users/user_edit.html @@ -157,6 +157,52 @@ ${h.end_form()} + + ## permissions overview +
${_('Name')} | +${_('Permission')} | +
---|---|
+ %if section == 'repositories': + ${k} + %elif section == 'repositories_groups': + ${k} + %else: + ${k} + %endif + | ++ %if section == 'global': + ${h.bool2icon(True)} + %else: + ${section_perm} + %endif + | +