summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--openstack_dashboard/dashboards/identity/users/tables.py5
-rw-r--r--releasenotes/notes/remove-change-pw-from-users-table-ef8d45a4a95762e0.yaml5
2 files changed, 9 insertions, 1 deletions
diff --git a/openstack_dashboard/dashboards/identity/users/tables.py b/openstack_dashboard/dashboards/identity/users/tables.py
index 3686f042d..edb8f7e34 100644
--- a/openstack_dashboard/dashboards/identity/users/tables.py
+++ b/openstack_dashboard/dashboards/identity/users/tables.py
@@ -54,12 +54,15 @@ class EditUserLink(policy.PolicyTargetMixin, tables.LinkAction):
return api.keystone.keystone_can_edit_user()
-class ChangePasswordLink(tables.LinkAction):
+class ChangePasswordLink(policy.PolicyTargetMixin, tables.LinkAction):
name = "change_password"
verbose_name = _("Change Password")
url = "horizon:identity:users:change_password"
classes = ("ajax-modal",)
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):
return api.keystone.keystone_can_edit_user()
diff --git a/releasenotes/notes/remove-change-pw-from-users-table-ef8d45a4a95762e0.yaml b/releasenotes/notes/remove-change-pw-from-users-table-ef8d45a4a95762e0.yaml
new file mode 100644
index 000000000..bb24aad24
--- /dev/null
+++ b/releasenotes/notes/remove-change-pw-from-users-table-ef8d45a4a95762e0.yaml
@@ -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.