I have 4 routes where each one will have a permission linked to it (provided by the backend -> true/false). These permissions give a logged-in user the authorization to access particular routes.
Now my question is if it is possible to make only one guard which checks all of the linked permissions, but only blocks the particular route where the linked permission is 'false'?
Example (4 features, with 4 permissions):
permissions: {
permission_1": false, // matches /post/create
permission_2": false, // matches /admin/post
permission_3": false, // matches /admin/delete
permission_4": true, // matches /subscribe
}
The guard checks only the matching permission for the particular route. In other words, the user will only have access to the "/subscribe" route and not for the other three.