Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Users without 'Delete users' permission can delete themselves #6095

Closed
leevigraham opened this issue May 18, 2020 · 9 comments
Closed

Users without 'Delete users' permission can delete themselves #6095

leevigraham opened this issue May 18, 2020 · 9 comments
Labels
enhancement improvements to existing features user management 😇 features related to user management

Comments

@leevigraham
Copy link
Contributor

Description

Users who do not have the 'delete users' permission can delete themselves. I'm not sure if theis is a bug or feature. A new 'can delete self' permission might be required.

Steps to reproduce

  1. Create a new user
  2. Login as user
  3. Delete user from 'my account'

Additional info

  • Craft version: 3.5.beta.2
  • PHP version:
  • Database driver & version:
  • Plugins & versions:
@leevigraham
Copy link
Contributor Author

It's expected behaviour:

image

@brandonkelly
Copy link
Member

It’s expected behavior.

@michaelrog
Copy link

Just out of curiosity... Why is it preferable for Users to be able to delete themselves, even if they don't have Delete User permission?

@andris-sevcenko
Copy link
Contributor

Just out of curiosity... Why is it preferable for Users to be able to delete themselves, even if they don't have Delete User permission?

I swear there's an amendment for that...

Sorry. I'll show myself out.

@brandonkelly
Copy link
Member

Because it’s their own account, they can do what they want with it.

@michaelrog
Copy link

What about situations where deleting a User could cause a rippling deletion of other content? By deleting themselves, a User could accidentally break site functionality, expunge necessary records, etc. (Theoretically, they could even do this from the front-end by sending a properly formed request, without any explicit UI provided.)

@brandonkelly
Copy link
Member

That’s a risk, yeah. I’ll go ahead and reopen and label this as an enhancement request, for a new user permission.

@brandonkelly brandonkelly reopened this May 20, 2020
@brandonkelly brandonkelly added enhancement improvements to existing features user management 😇 features related to user management labels May 20, 2020
@leevigraham
Copy link
Contributor Author

What about situations where deleting a User could cause a rippling deletion of other content? By deleting themselves, a User could accidentally break site functionality, expunge necessary records, etc. (Theoretically, they could even do this from the front-end by sending a properly formed request, without any explicit UI provided.)

Another potential issue which I don't think is covered is an admin deleting themselves if they are the last admin.

@michaelrog
Copy link

Avatar II: The Last Admin

@craftcms craftcms locked and limited conversation to collaborators Jun 22, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement improvements to existing features user management 😇 features related to user management
Projects
None yet
Development

No branches or pull requests

4 participants