Skip to content
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

Fixes #25466: A user should not be able to delete themselves in user management 8.2 #5877

Open
wants to merge 1 commit into
base: branches/rudder/8.2
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ displayRightPanel model user =

formSubmitSection provider =
[ div [ class "btn-container" ]
[ button [ class "btn btn-sm btn-danger btn-delete", onClick (OpenDeleteModal user.login) ] [ text "Delete" ]
[ displayDeleteButton model user
, button
[ class
("btn btn-sm btn-status-toggle "
Expand Down Expand Up @@ -514,6 +514,12 @@ displayRightPanel model user =
)
]

displayDeleteButton : Model -> User -> Html Msg
displayDeleteButton model user = -- Do not display button for current user
if user.login == model.userId then
text ""
else
button [ class "btn btn-sm btn-danger btn-delete", onClick (OpenDeleteModal user.login) ] [ text "Delete" ]

displayUsersConf : Model -> Html Msg
displayUsersConf model =
Expand Down