feat(security): Gate course, instructor, and admin URL prefixes by role#96
Merged
Conversation
Phase 1 of the course management by role plan: - SecurityConfig: /instructor/** requires ROLE_INSTRUCTOR, /admin/** requires ROLE_ADMIN, /courses/** requires authentication; method security enabled for upcoming service-level ownership rules; the ERROR dispatch is permitted so the error templates can render. - Styled error pages (403, 404, 500) on the shared layout with the RGAA wiring, replacing the Whitelabel fallback. - Role-aware navigation: Instructor and Admin entries appear only for their roles, with the aria-current wiring of the existing entries. - SecurityMatrixTest: access matrix per role and prefix (anonymous is redirected to login, wrong role gets 403, right role passes the gate); gate-pass asserts 404 until each controller phase lands. Verified in the browser: anonymous /courses redirects to login, a student gets the styled 403 on /instructor/courses, the Instructor nav entry appears once the role is granted, and axe (WCAG 2.1 A/AA and best-practice rules) reports zero violations on the 403 and 404 pages (the flagged brand mark is a logotype, exempt under WCAG 1.4.3).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #96 +/- ##
============================================
+ Coverage 81.30% 81.60% +0.29%
Complexity 62 62
============================================
Files 23 23
Lines 246 250 +4
Branches 13 13
============================================
+ Hits 200 204 +4
Misses 32 32
Partials 14 14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 1 of the course management by role plan:
requires ROLE_ADMIN, /courses/** requires authentication; method
security enabled for upcoming service-level ownership rules; the
ERROR dispatch is permitted so the error templates can render.
RGAA wiring, replacing the Whitelabel fallback.
their roles, with the aria-current wiring of the existing entries.
redirected to login, wrong role gets 403, right role passes the
gate); gate-pass asserts 404 until each controller phase lands.
Verified in the browser: anonymous /courses redirects to login, a
student gets the styled 403 on /instructor/courses, the Instructor nav
entry appears once the role is granted, and axe (WCAG 2.1 A/AA and
best-practice rules) reports zero violations on the 403 and 404 pages
(the flagged brand mark is a logotype, exempt under WCAG 1.4.3).
This is part 1 of 2 in a stack made with GitButler: