Auth/Actions: Allow defining bool expression checks in action permissions #8825
Labels
a/authz
Issues related to "authorization" and the policy engine after session claims are procesed
c/actions
Related to actions
k/enhancement
New feature or improve an existing feature
k/v3-beta
t/gql-services
Is your proposal related to a problem?
Motivation: We often find ourselves making queries to the database in the beginning of almost every action for verifying things like:
Describe the solution you'd like
Hasura to allow defining action permissions based on bool checks built from data in the database, action arguments and session variables. This way, we can avoid writing a lot of repitetive validation by hand. Some sample solutions:
Checking whether a user is allowed to use a feature. This can be achieved by a bool expression:
Proceed with execution only if user is the author of an article. This can be achieved by a bool expression:
Error definition
Since actions deal with custom business logic, it's important to allow defining custom errors (or error codes) about why the action invocation has failed. Most ideally, I'd like to configure this while defining permissions. Suggested solution:
I think this, combined with REST connectors would really be a big step towards improving DX in actions because.
Describe alternatives you've considered
Writing these permission rules by hand.
If the feature is approved, would you be willing to submit a PR?
No.
The text was updated successfully, but these errors were encountered: