-
Notifications
You must be signed in to change notification settings - Fork 59
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
Add grants support to Streamlit entity #1981
Conversation
Duplicate #1967 ? |
242c0ad
to
b10eef2
Compare
for grant in entity_model.grants: | ||
self.execute_query(grant.get_grant_sql(entity_model)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small improvement: execute all grants in single query
class GrantBaseModel(UpdatableModel): | ||
grants: Optional[List[Grant]] = Field(title="List of grants", default=None) | ||
|
||
def get_grant_sqls(self) -> list[str]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add this to StreamlitEntity.get_grant_sql
role: str = Field(title="Role to which the privileges will be granted") | ||
|
||
def get_grant_sql(self, entity_model: EntityModelBase) -> str: | ||
return f"GRANT {self.privilege} ON {entity_model.get_type().upper()} {entity_model.fqn.sql_identifier} TO ROLE {self.role}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In relation to my PR #1967 , will this allow the ability to grant share privileges on a Streamlit app? It appears Streamlit uses WITH GRANT OPTION
to achieve this today.
Pre-review checklist
Changes description
...