pinterest / querybook

Querybook is a Big Data Querying UI, combining collocated table metadata and a simple notebook interface.
https://www.querybook.org
Apache License 2.0
1.87k stars 226 forks source link

Role/Environment based access control #658

Open czgu opened 2 years ago

czgu commented 2 years ago

We had an internal request to disable scheduling in one of the environments due to security reasons. The intention for this github issue is to make things like that more generalizable. We can consider to have a list of rules in a table with the following format:

Environment UserGroup control
1 Viewer Disable execution
2 * Disable scheduling

So environment is id, usergroup can be null (in which case applies to all users in the environment) or a user group. In case if multiple applies, the more specific/newer one wins the tie breaker.

Controls can be used to represent the removal of default features. Here are some of the controls I can think of:

When these rule apply, the UI will be different (for example, if you can't run queries then the run button will be shown with a message). Backend should also enforce these rules as well.

Aka-shi commented 2 years ago

Does this also introduce multiple roles in Querybook? Currently we have only ADMIN role, will this change include adding VIEWER, EDITOR roles?

czgu commented 2 years ago

yeah we can have some default roles such as ADMIN, EDITOR, and VIEWER and allow custom roles to be added