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

Only Super Admin should be able to change user roles #452

Open
devangm opened this issue Jan 7, 2025 · 1 comment · May be fixed by #453
Open

Only Super Admin should be able to change user roles #452

devangm opened this issue Jan 7, 2025 · 1 comment · May be fixed by #453
Assignees
Labels
bug Something isn't working

Comments

@devangm
Copy link

devangm commented Jan 7, 2025

Issue in tandem with Scholars Angular 411

Administrators should be able to see data & analytics, whereas super admins should be able to manage roles, etc.

Updating here based on what William suggested:

https://github.com/TAMULib/scholars-discovery/blob/tamu-main/src/main/java/edu/tamu/scholars/middleware/config/WebSecurityConfig.java#L178https://github.com/TAMULib/scholars-discovery/blob/tamu-main/src/main/java/edu/tamu/scholars/middleware/config/WebSecurityConfig.java#L178

Remove "/users/{id}" from hasRole("ADMIN") and add another entry for SUPER_ADMIN..e.g.
```
.antMatchers(PATCH, "/users/{id}")
.hasRole("SUPER_ADMIN")

@devangm devangm added the bug Something isn't working label Jan 7, 2025
@wwelling
Copy link

wwelling commented Jan 8, 2025

This will also require update in scholars-angular for disallowing admin to manage users.

https://github.com/TAMULib/scholars-angular/blob/tamu-main/src/app/app-routing.module.ts#L13

Removing Role.ROLE_ADMIN from the admin section is adequate for now.

If time permits, I think it would be more appropriate to add another role ROLE_MANAGER or something similar for the users who have access to data & analytics.

@Dbreck-TAMU Dbreck-TAMU self-assigned this Jan 13, 2025
@Dbreck-TAMU Dbreck-TAMU linked a pull request Jan 13, 2025 that will close this issue
@kaladay kaladay moved this from 👷 In Planning to 🏃 On Sprint in Scholars@TAMU Jan 14, 2025
@kaladay kaladay linked a pull request Jan 14, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🏃 On Sprint
3 participants