All problems

Allow rules override explicit denials in rehearsal room policies

Level 2 · node · Security · Explicit denial precedence across multiple group policies

Scenario

A fictional rehearsal room management service stores usage policies for each room. A visitor may belong to several groups, and each group policy allows or denies actions such as rehearsing or recording. Explicit denials must override permissions from other groups, but visitors matching both kinds of policy are shown as permitted to perform a prohibited action.

Requirements

Evaluate policies matching the room, visitor's group list, and requested action, returning a boolean. Deny if any applicable policy explicitly denies the action; otherwise allow only when an applicable allow policy exists. Policy storage order must not affect the result. Deny requests for unregistered rooms as well.

Acceptance criteria

  • Allow usage when only applicable allow policies exist for the action.
  • When both allow and deny policies apply, deny regardless of storage order.
  • Deny when only deny policies apply or no policy applies.
  • Policies for other actions, rooms, or groups the visitor does not belong to must not affect the decision.