-
-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
P2Important — depends on P1Important — depends on P1phase:2-orgsPhase 2: Multi-tenancy & OrganizationsPhase 2: Multi-tenancy & Organizations
Description
Description
Include CASL abilities in auth responses so the Vue frontend can consume them without dedicated policy files.
Details
POST /api/auth/signinresponse addsabilitiesarrayGET /api/auth/tokenresponse addsabilitiesarray- Abilities are built from user + current organization membership
- Format:
[{ action, subject, conditions }]— compatible withcreateMongoAbility()
Response example
{
"user": {
"_id": "abc123",
"firstName": "Pierre",
"roles": ["user"],
"currentOrganization": {
"_id": "org456",
"name": "Acme Inc",
"slug": "acme-inc",
"plan": "free"
},
"membership": {
"role": "owner",
"organizationId": "org456"
}
},
"tokenExpiresIn": "...",
"abilities": [
{ "action": "manage", "subject": "Task", "conditions": { "organizationId": "org456" } },
{ "action": "read", "subject": "Organization", "conditions": { "_id": "org456" } }
]
}Acceptance criteria
- Abilities included in signin response
- Abilities included in token refresh response
- Abilities format compatible with @casl/ability createMongoAbility
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important — depends on P1Important — depends on P1phase:2-orgsPhase 2: Multi-tenancy & OrganizationsPhase 2: Multi-tenancy & Organizations