Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@casl & Hasura permissions for multiple roles #32

Open
4 tasks
jozef-slezak opened this issue Jun 14, 2021 · 0 comments
Open
4 tasks

@casl & Hasura permissions for multiple roles #32

jozef-slezak opened this issue Jun 14, 2021 · 0 comments

Comments

@jozef-slezak
Copy link
Contributor

jozef-slezak commented Jun 14, 2021

@msvoro, this issue continues #31

Pages accessible only for certain roles

Entity Fields accessible only for certain roles

Extend Hasura for quering permissions

Implement either hasura action (on top of hasura permissions tables/views or rest api https://hasura.io/docs/latest/graphql/core/auth/authorization/permission-rules.html) or postgres function

query currentUserAbilities {
  currentUserAbilities {
    action
    subject
    fields
    conditions
  }
]

returns:

[
  {
    action: ['select', 'insert', 'update'],
    fields: ['id', 'seq', 'name', ...], 
    subject: 'Entity1',
    conditions: { created_by: '%current_user%'}
  },
  {
    inverted: true,
    action: ['select', 'insert', 'update', 'delete'],
    fields: ['id', 'seq', 'name', ...],
    subject: 'Entity2',
    conditions: { created_by: '%current_user%'}
  }
]

FYI, this example pull request will be used for codegen as an example.

@jozef-slezak jozef-slezak changed the title SPA permissions for multiple roles casl & Hasura permissions for multiple roles Jun 17, 2021
@jozef-slezak jozef-slezak changed the title casl & Hasura permissions for multiple roles @casl & Hasura permissions for multiple roles Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant