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

Role based schema selection #847

Open
davemaier opened this issue Jul 17, 2020 · 3 comments
Open

Role based schema selection #847

davemaier opened this issue Jul 17, 2020 · 3 comments
Labels
backend:server Issues relating to Cube Core's Server enhancement New feature proposal

Comments

@davemaier
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Since we have many different types of users on our system and the users have different needs and most importantly different permissions, a one schema fits all approach is very hard to accomplish. A simple example are the roles of an analyst and a normal user. The normal user should only be able to see her/his data (enforced row level security) and the data analyst should see all the uses data.

Describe the solution you'd like
It would be great if it was possible to include a "role" key into the JWT that decides on which version of schema is used. The different versions of the could be differentiated ether by putting them into different folders oder appending the role name to the cube names.

Describe alternatives you've considered
I'm currently working around this by using complicated where clauses in my cubes.

Additional context
none

@paveltiunov
Copy link
Member

Hey @davemaier ! Cube.js schema has a concept of context https://cube.dev/docs/context#top which isn't properly exposed yet. These contexts can be bound to the roles in order to provide RBAC. Let's use this issue to track this context and related APIs implementation.

@paveltiunov paveltiunov added the enhancement New feature proposal label Jul 22, 2020
@barakcoh
Copy link
Contributor

hi @paveltiunov, I'm curious if any progress has been made on an RBAC model. right now the choices for enforcing permissions seem to be:

  • Rely on the database, e.g. PG's row-level-security and roles (probably using multiple connections)
  • Modify the query at run-time to by adding filters to limit rows, removing dimensions/measure to limit columns etc.

The first option would likely be secure enough but doesn't allow the app/UI to properly reflect permissions and the latter requires a lot of manual work to build an entire authz on top of Cube

@paveltiunov
Copy link
Member

@barakcoh RBAC still should be solved mostly with contexts and contexts release is still on our roadmap: #2145. The best place for row-based security is queryTransformer as of right now: https://cube.dev/docs/multitenancy-setup#security-context-vs-query-transformer.

@paveltiunov paveltiunov added question The issue is a question. Please use Stack Overflow for questions. and removed enhancement New feature proposal labels Feb 20, 2021
@hassankhan hassankhan added backend:server Issues relating to Cube Core's Server enhancement New feature proposal and removed question The issue is a question. Please use Stack Overflow for questions. labels May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:server Issues relating to Cube Core's Server enhancement New feature proposal
Projects
None yet
Development

No branches or pull requests

4 participants