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

[Fix] Role Change Logic for Super Admin and Other Roles #8703

Open
rahul-rocket opened this issue Jan 6, 2025 · 0 comments
Open

[Fix] Role Change Logic for Super Admin and Other Roles #8703

rahul-rocket opened this issue Jan 6, 2025 · 0 comments
Assignees
Labels
priority: highest This issue is top priority scope: app App UI scope type: bug 🐛 Something isn't working

Comments

@rahul-rocket
Copy link
Collaborator

rahul-rocket commented Jan 6, 2025

Description:

Currently, the system allows users, including the Super Admin, to change their roles in ways that are not intended. Specifically:

  1. The Super Admin can change their role to a lower one even when no other Super Admin exists.
  2. Users can increase their own roles to higher levels, including Super Admin.

These issues need to be addressed to ensure role management adheres to the intended logic.

Acceptance Criteria:

  1. Super Admin Role Changes:
  • A Super Admin can only change their role to a lower one if there is at least one other Super Admin in the database.
  • If the above condition is not met, the role change should be disallowed, and the user should be notified with an appropriate message.
  1. Promoting Users to Super Admin:
  • Only an existing Super Admin can promote another user to the Super Admin role.
  • A user cannot promote themselves to Super Admin under any circumstances.
  1. Self-Role Changes:
  • No user, except a Super Admin under the condition mentioned above, should be able to change their own role to a higher level.

Steps to Reproduce:

  1. Log in as a Super Admin.
  2. Attempt to change your role to a lower one when there are no other Super Admins.
  3. Log in as a user with a non-Super Admin role.
  4. Attempt to change your own role to a higher level, including Super Admin.
@rahul-rocket rahul-rocket self-assigned this Jan 6, 2025
@rahul-rocket rahul-rocket added type: bug 🐛 Something isn't working scope: app App UI scope priority: highest This issue is top priority labels Jan 6, 2025
rahul-rocket added a commit that referenced this issue Jan 6, 2025
@rahul-rocket rahul-rocket reopened this Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: highest This issue is top priority scope: app App UI scope type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant