Repository navigation
feat: enforce permission-aware service and admin access - #11
Merged
Merged
Conversation
Add the admin application access permission and seed it for staff-facing roles. Return each authenticated user's deduplicated roles and permissions from the current-user endpoints.
Protect role and permission reads and mutations with their corresponding permissions. Support method-aware and path-aware middleware rules so shared Axum routes cannot bypass authorization.
Guard feature routes and provide an access-denied destination for authenticated users without administrative access. Filter navigation and command results, and hide catalogue, order, people, role, and permission actions the current user cannot perform. Centralize permission names and access checks for consistent reuse across future admin features.
Exercise effective access lookup for staff, customers, and unknown users with reviewed Insta snapshots. Cover unauthenticated and unauthorized role and permission requests across read and mutation methods. Verify the admin access helpers and align client error fixtures with the structured API error contract.
Authenticate privileged request cases as the seeded administrator and update John Doe's current email. Make order ownership and denial fixtures explicitly establish customer and permission state. Review snapshots for the expanded staff roles and updated user assignments.
Use the current John Doe email in duplicate, lookup, password, token, and profile model cases. Review user snapshots for the updated John Doe and Morgan Grimes seed addresses. Preserve the intended repository assertions while eliminating false not-found and duplicate-success results.
# Conflicts: # service/tests/requests/roles.rs # service/tests/requests/snapshots/auth/[email protected] # service/tests/requests/snapshots/auth/[email protected]
Record John Doe's current email in the checkout result. Include the two newly seeded staff role-permission grants in the complete assignment list. Review both changes through cargo insta review and verify the previously failing cases directly.
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.
Summary
Test fixes
Verification