OpenBook
  • Problems
  • Tracks
  • How it works
  • Pricing
Start practicingSign In
Problems/Auth & Permissions

6. Role-Based Permissions

Hard

Organizations, roles, and resource-level permission checks with inheritance.

50 minute budget38.0% acceptanceRBAC · policies

Requirements

  1. 01Roles: owner, admin, editor, viewer, from highest to lowest; a role includes everything the roles below it may do.
  2. 02Every request names the acting user in an x-user header; a member's role is per organization.
  3. 03Documents belong to an organization; a document route answers 403 when the acting user lacks the permission.
  4. 04GET /orgs/:org/can?user=&action= exposes the same can(user, action, resource) helper that guards every route.
  5. 05The user who creates an organization is its first owner and adds members and their roles.

What the hidden tests check

  • Everything the interviewer tells you is checked, for every role on the ladder.
  • A role change or removal takes effect on the very next request, in that organization only.

4 more details are held back. In a mock interview they come out only when you ask the interviewer the right question; in practice they are listed in the workspace.

Sign in to start

Attempts, files and transcripts are saved to your account so the grader can review how you worked.

Sign inCreate an account
OpenBook

Practice for interviews where you build a feature with an AI assistant.

Early preview. Problems, grading and the interviewer are still changing.

Practice

  • Problems
  • Tracks
  • How it works
  • Pricing

Legal

  • Terms
  • Privacy
© 2026 OpenBook.