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

28. Attribute-Based Access

Hard

Users and reports carry department, region and clearance; admins write allow and deny rules over them, and every report route asks the rules.

55 minute budget0.0% acceptanceABAC · policies · authorization

Requirements

  1. 01PUT /users/:id sets a user's department, region and clearance; POST /reports creates a report with a title and the same three attributes.
  2. 02POST /rules stores an allow or deny rule for one action (read, write, delete) with conditions on user and report attributes; GET /rules lists them, DELETE /rules/:id removes one.
  3. 03A user condition may use "$resource" to mean the report's value of the same attribute.
  4. 04POST /evaluate { user, action, report } answers { decision, rule }: allow or deny, and the id of the rule that decided.
  5. 05GET, PUT and DELETE /reports/:id enforce read, write and delete for the user in x-user: 401 without a known user, 403 with the deciding rule when denied.

What the hidden tests check

  • Everything the interviewer tells you is checked.
  • The deciding rule id is checked as well as the decision, and rule or user changes apply on the very next request.

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.