ansible / django-ansible-base

Apache License 2.0
11 stars 43 forks source link

Prevent disabling or deleting the last enabled authenticator #513

Closed jctanner closed 1 month ago

jctanner commented 1 month ago

https://issues.redhat.com/browse/AAP-26867

mabashian commented 1 month ago

I guess there's really two scenarios we need to account for here:

  1. We should prevent a user from disabling the last enabled authenticator
  2. We should prevent a user from deleting the last enabled authenticator

Maybe you had already thought through that @jctanner but I had only thought about scenario 2 initially

jctanner commented 1 month ago

@mabashian we have a indirect gate in the view that throws an error if you try to delete an authenticator that is still attached to a user, which I guess would always get thrown due to the system user.

I can also extend this patch to directly prevent deletion of the last enabled authenticator.

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
81.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud