backend icon indicating copy to clipboard operation
backend copied to clipboard

Transfer groundControl (and admin panel) from staff to admin route

Open josh1248 opened this issue 1 year ago • 3 comments

Accompanies the frontend pull request at https://github.com/source-academy/frontend/pull/3043

Previously, "admin" routes were available to both staff and admins to access.

Now, a new "staff" route has been created that accepts most of the previous functions. The remaining functions in "admin" scope have the ability to cause massive damage, such as the deletion of entire assessments. Hence, they are now inaccessible to avengers even if they bypass the frontend route checking.

Aside: I have also shifted admin panel actions into this admin scope.

josh1248 avatar Sep 08 '24 18:09 josh1248

Coverage Status

coverage: 93.661% (-0.1%) from 93.78% when pulling fe8c762a46801c6a3beda6b205a53feb32c6bb10 on GabrielCWT:No-GC-For-Staff into 71192c3079111ad0708ff145d17014100f4df2ab on source-academy:master.

coveralls avatar Sep 08 '24 18:09 coveralls

The new scope has caused the test error codes to change from 400 to 403 - will update the tests for staffs and admins.

josh1248 avatar Sep 10 '24 08:09 josh1248

image

Error messages are no longer being generated at the controller level but rather at the router level due to the changes, which causes the tailored error messages to be hidden. I was wondering if this was something I should revert? Alternatively, it could be possible to make the admin check a per-route check, allowing for different error messages rather than a generic "403 Forbidden". Would take some time, though (should still be manageable to bulk-change).

josh1248 avatar Oct 07 '24 00:10 josh1248

Ready for review!

josh1248 avatar Oct 13 '24 14:10 josh1248

Apologies for missing this out - I have reverted the accidental formatting changes!

josh1248 avatar Nov 13 '24 09:11 josh1248