An example of using RomainLanz/adonis-guard Authorization with dynamic rules finding.
The core logic is implemented at App/Validators/BaseValidator.js
For RESTFUL API, the BaseValidator:
- Matches
ResourceControllerwithApp/Policies/ResourcePolicyand authorize the route - Find and load
Resourcefrom DB if the id is set. E.g. if requestresources/:idis given, the validator loads the resource and pass it through the controller context.