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

moderation: add self-action prevention #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Samk13
Copy link
Member

@Samk13 Samk13 commented Apr 26, 2024

❤️ Thank you for your contribution!

Description

  • The problem is that an admin could block his own account. With this change, it is possible to prevent the admin from doing that.
  • Prevent self-action for: block, deactivate, restore, activate, impersonate and approve.
  • Update tests for self-action prevention
  • introduce the PreventSelf generator
  • introduce _check_permission in users service
  • add "PreventSelf" into can_manage and can_impersonate permission
  • closes User Management: Admins Can Inadvertently Block Themselves Out. invenio-administration#203

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Frontend

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

@Samk13 Samk13 added the enhancement New feature or request label Apr 26, 2024
@Samk13 Samk13 marked this pull request as ready for review April 26, 2024 09:55
@Samk13 Samk13 force-pushed the prevent-self-actions branch 8 times, most recently from b031633 to b169f51 Compare May 3, 2024 11:37
* The problem is that an admin could block his own account. With this change it is possible to prevent the admin from doing that.
* Prevent self-action for: block, deactivate, restore, activate and approve.
* Update tests for self-action prevention
* introduce PreventSelf generator
* introduce _check_manage_permissions in users service
* add "PreventSelf" into "can_manage" permission
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: To review
Development

Successfully merging this pull request may close these issues.

User Management: Admins Can Inadvertently Block Themselves Out.
1 participant