-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
condition change to support password reset #5053
Conversation
Signed-off-by: Rajshekar Chavakula <[email protected]>
Signed-off-by: Rajshekar Chavakula <[email protected]>
Don't forget the changelog entry :) |
Signed-off-by: Rajshekar Chavakula <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not merge.
// Change the resource to LocalSelfUserResource if a user tries to change | ||
// its own password | ||
if attrs.Verb == "update" && vars["subresource"] == "password" { | ||
// check if request comes from webui | ||
if strings.Contains(r.URL.Path, "/change_password") { | ||
attrs.Resource = types.LocalSelfUserResource | ||
} | ||
|
||
switch vars["subresource"] { | ||
case "password": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code should work in terms of the RBAC system only, and not rely on inspecting URL fragments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: Rajshekar Chavakula <[email protected]>
What is this change?
This change allows web UI users to update password by themselves.
Why is this change necessary?
feature request in ticket https://github.com/sensu/sensu-enterprise-go/issues/2631
Does your change need a Changelog entry?
requires entry to changelog, api documentation
Do you need clarification on anything?
Were there any complications while making this change?
Have you reviewed and updated the documentation for this change? Is new documentation required?
How did you verify this change?
Manual testing done, attached recording.
Screen.Recording.2024-02-14.at.9.46.00.PM.mov
Is this change a patch?