QuizzesRBAC & Scopes — Roles, Permissions, Ownership — Concept Check
intermediate
fastapi

RBAC & Scopes — Roles, Permissions, Ownership — Concept Check

Questions on RBAC & Scopes — Roles, Permissions, Ownership. Layer authorization: coarse roles via require_role, fine-grained permissions via a role→permission map, OAuth2 scopes via SecurityScopes when tokens must carry grants — plus the ownership checks RBAC alone misses.

7 minutes 7 questions Pass at 70%
Time Limit
7 minutes - timer starts when you begin
Change Answers Freely
Revisit and change any answer before submitting
Full Review After Submit
Correct answers and explanations shown for every question
Auto-submit on timeout
Quiz submits automatically when time runs out

Questions in this quiz

7 questions on RBAC & Scopes — Roles, Permissions, Ownership — Concept Check. Work through them here, then start the quiz to answer them and see your score.

  1. 1.A student attempts to access another student's offer letter. What check should be implemented to prevent this unauthorized access?

    • AOAuth2 scopes
    • BOwnership check
    • CJWT token expiration
    • DRole-based access control (RBAC)
  2. 2.A company wants to allow third-party services to access its API with specific permissions. What mechanism should they use?

    • AOAuth2 scopes
    • BOwnership checks
    • CJWT roles
    • DRole-based access control (RBAC)
  3. 3.A new role 'placement-coordinator' needs to be added with specific permissions. How should this be handled in the system?

    • AModify every endpoint to check for the new role
    • BAdd a new entry to the role→permissions map
    • CUpdate the JWT token structure
    • DCreate a new OAuth2 scope for the role
  4. 4.A service needs to verify if a user can 'drives:create'. What should it check?

    • AUser's permissions from the role→permissions map
    • BUser's role in the JWT
    • CUser's ownership of the drive
    • DOAuth2 scope in the token
  5. 5.Why are OAuth2 scopes preferred for service-to-service communication?

    • AThey eliminate the need for ownership checks
    • BThey are easier to implement than roles
    • CThey are embedded in JWT tokens
    • DThey allow fine-grained access control
  6. 6.What happens if a required OAuth2 scope is missing in a token during an API call?

    • AThe request is rejected with a 403 error
    • BThe request is redirected to the login page
    • CThe request is logged for future analysis
    • DThe request is allowed with limited access
  7. 7.When a TPO's permissions change, what is the advantage of using a role→permissions map?

    • AIt automatically updates OAuth2 scopes
    • BIt requires less frequent token refresh
    • CIt simplifies endpoint management
    • DIt requires updating the JWT token