Authouriztion
We use casl to check user ability with some changes.
Rule structure
{
"name": string,
"description": string,
"actions": array,
"subject": array,
"roles": array,
"fields" : array,
"conditions": object when hardcoded \ stringify on DB,
"userContext" : object when hardcoded \ stringify on DB,
"populateWhitelist" : array,
"anonymousUser" : bollean,
"active" : bollean,
"from" : date,
"to": date
}You can define rules in 3 places:



Service default rules
Each rule define by this fields:
schema
Example of rules:
When user make request to one service and from this service you make another request to other service, you need to persist user and provider to get response from the other service base is user abilities, read this:
Persist user requestLast updated
Was this helpful?