WS-7 Observability — closure #8
@@ -15,20 +15,19 @@ use Illuminate\Http\Request;
|
||||
* 1. Portal-token request → PORTAL_TOKEN
|
||||
* 2. Authenticated super_admin → SUPER_ADMIN
|
||||
* 3. Authenticated org_admin → ORGANIZER_ADMIN
|
||||
* 4. Other authenticated user → ORG_MEMBER (covers volunteers — Crewli has
|
||||
* no `volunteer` Spatie role today; volunteers join an organisation as
|
||||
* org_member with org-pivot semantics. Promote to a dedicated case once
|
||||
* the role model differentiates them at the user level.)
|
||||
* 4. Other authenticated user → ORG_MEMBER
|
||||
* 5. None of the above → UNAUTHENTICATED
|
||||
*
|
||||
* The VOLUNTEER case is reserved for that future split.
|
||||
* Crewli has no dedicated `volunteer` Spatie role today; volunteer-ness is
|
||||
* behaviour (a user has shift assignments) rather than identity. A
|
||||
* dedicated VOLUNTEER actor_type case will land alongside that role split
|
||||
* if/when it is introduced (BACKLOG OBS-1).
|
||||
*/
|
||||
enum ActorType: string
|
||||
{
|
||||
case ORGANIZER_ADMIN = 'organizer_admin';
|
||||
case SUPER_ADMIN = 'super_admin';
|
||||
case PORTAL_TOKEN = 'portal_token';
|
||||
case VOLUNTEER = 'volunteer';
|
||||
case ORG_MEMBER = 'org_member';
|
||||
case UNAUTHENTICATED = 'unauthenticated';
|
||||
|
||||
|
||||
@@ -140,9 +140,8 @@ final class BindSentryContextTest extends TestCase
|
||||
|
||||
public function test_org_member_authenticated_user_tags_actor_type_org_member(): void
|
||||
{
|
||||
// Crewli has no `volunteer` Spatie role today; volunteers fall into
|
||||
// org_member. The VOLUNTEER ActorType case is reserved for a future
|
||||
// split — see ActorType::resolve() docblock.
|
||||
// Volunteer-ness is behaviour in Crewli (shift assignments), not
|
||||
// identity — non-admin authenticated users resolve to ORG_MEMBER.
|
||||
$user = User::factory()->create();
|
||||
$user->assignRole('org_member');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user