Browse Source

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

Zuul 4 months ago
parent
commit
0ccfce8827

+ 4
- 1
openstack_dashboard/dashboards/identity/users/tables.py View File

@@ -54,12 +54,15 @@ class EditUserLink(policy.PolicyTargetMixin, tables.LinkAction):
54 54
         return api.keystone.keystone_can_edit_user()
55 55
 
56 56
 
57
-class ChangePasswordLink(tables.LinkAction):
57
+class ChangePasswordLink(policy.PolicyTargetMixin, tables.LinkAction):
58 58
     name = "change_password"
59 59
     verbose_name = _("Change Password")
60 60
     url = "horizon:identity:users:change_password"
61 61
     classes = ("ajax-modal",)
62 62
     icon = "key"
63
+    policy_rules = (("identity", "identity:update_user"),)
64
+    policy_target_attrs = (("user_id", "id"),
65
+                           ("target.user.domain_id", "domain_id"))
63 66
 
64 67
     def allowed(self, request, user):
65 68
         return api.keystone.keystone_can_edit_user()

+ 5
- 0
releasenotes/notes/remove-change-pw-from-users-table-ef8d45a4a95762e0.yaml View File

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

Loading…
Cancel
Save