Merge "Remove "Change Password" from users table for non-admin users" into stable/rocky

This commit is contained in:
Zuul 2018-11-30 10:54:48 +00:00 committed by Gerrit Code Review
commit 0ccfce8827
2 changed files with 9 additions and 1 deletions

View File

@ -54,12 +54,15 @@ class EditUserLink(policy.PolicyTargetMixin, tables.LinkAction):
return api.keystone.keystone_can_edit_user() return api.keystone.keystone_can_edit_user()
class ChangePasswordLink(tables.LinkAction): class ChangePasswordLink(policy.PolicyTargetMixin, tables.LinkAction):
name = "change_password" name = "change_password"
verbose_name = _("Change Password") verbose_name = _("Change Password")
url = "horizon:identity:users:change_password" url = "horizon:identity:users:change_password"
classes = ("ajax-modal",) classes = ("ajax-modal",)
icon = "key" icon = "key"
policy_rules = (("identity", "identity:update_user"),)
policy_target_attrs = (("user_id", "id"),
("target.user.domain_id", "domain_id"))
def allowed(self, request, user): def allowed(self, request, user):
return api.keystone.keystone_can_edit_user() return api.keystone.keystone_can_edit_user()

View File

@ -0,0 +1,5 @@
---
fixes:
- |
Fixed a bug where non-admin users would be shown the "Change Password"
button for users listed under the Identity panel.