Fix RBAC misconfiguration for /users/guards endpoint (Phase 1)#275
Fix RBAC misconfiguration for /users/guards endpoint (Phase 1)#275LoopyB wants to merge 1 commit into
Conversation
…o admin (phase 1 RBAC fix)
|
Hey |
|
Hey Krish, quick clarification on this one. At the moment the endpoint returns all guards with no employer/org scoping, so allowing EMPLOYER here would expose global guard data across tenants. That’s why I restricted it to admin only in Phase 1. Happy to enable employer access, but I think we should do it with scoped filtering (guards linked to the employer’s organisation), otherwise we’ll leak data. Do you want:
I can implement either, just want to confirm direction (fyi phase 2 and 3 are outlined in the ticket in Teams) |
|
Since the platform operates as a free marketplace rather than an organisation-locked system, guards are not permanently tied to any single organisation. Instead, they exist as independent users who can browse and apply for shifts across multiple organisations. To implement scoped access in this model, the relationship between a guard and an organisation should be contextual and temporary, based on shift applications rather than fixed assignments. A practical approach is: Guards apply to shifts posted by organisations. This means: No permanent guard–organisation mapping is required. In short, the system should treat the guard–organisation relationship as event-driven (per shift) rather than structural (per organisation). |
|
Updated the Phase 2/3 proposal based on the marketplace model in the Teams ticket. Switched from organisation-based scoping to shift-based (application/assignment-driven) access. Let me know if that aligns |
Quick PR addresses an RBAC issue in the
/api/v1/users/guardsendpoint.Issue
EMPLOYEEFix (Phase 1)
EMPLOYEEADMINonly for nowNotes
Employer access will require:
This will be handled in a follow-up task.