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

Clean up UserRules #6657

Merged
merged 1 commit into from
Sep 17, 2024
Merged

Clean up UserRules #6657

merged 1 commit into from
Sep 17, 2024

Conversation

distantnative
Copy link
Member

@distantnative distantnative commented Sep 8, 2024

Description

Summary of changes

  • Added guards for non-admin changing admins as well as changing last admin to UserPermissions::canChangeRole() instead of UserRules::changeRole()
  • Deprecated UserRules::validRole() as checks need to be more specific with a specific roles collection that this helper method cannot provide
  • Added instead a role validation check to UserRules::changeRole()
  • Removed permissions check from UserRules::create() that Is already covered by the general permissions check running UserPermissions::canCreate()

Changelog

Deprecated

  • UserRules::validRole()

Ready?

  • In-code documentation (wherever needed)
  • Unit tests for fixed bug/feature
  • Tests and CI checks all pass

@distantnative distantnative marked this pull request as ready for review September 16, 2024 17:44
@distantnative distantnative requested a review from a team September 16, 2024 17:44
@bastianallgeier bastianallgeier merged commit 981a2c6 into develop-minor Sep 17, 2024
14 checks passed
@bastianallgeier bastianallgeier deleted the enhancement/user-rules branch September 17, 2024 08:49
@bastianallgeier bastianallgeier added this to the 4.5.0 milestone Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: refactoring ♻️ Is about bad code; cleans up code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants