research-software-directory / RSD-as-a-service

This repo contains the new RSD-as-a-service implementation
https://research.software
23 stars 15 forks source link

rsd-admin can add/remove rsd-admin role to other users #1066

Closed dmijatovic closed 9 months ago

dmijatovic commented 9 months ago

Assign rsd admin role

Changes proposed in this pull request:

How to test:

Change professor3 to rsd-admin

image

Cannot change its own role

image

PR Checklist:

sonarcloud[bot] commented 9 months ago

[rsd-frontend] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

33.9% 33.9% Coverage
0.0% 0.0% Duplication

ewan-escience commented 9 months ago

I did notice one race condition. If two users, both admin, are logged in at the same time in a different browser, they can delete each others admin rights and that way delete the last admin ;-)

You can then create an admin directly in the database again, so I'm ok with this.