Skip to content

Commit 0960a05

Browse files
fixing grants issue
1 parent 48b6a2f commit 0960a05

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/snowflake/cli/_plugins/streamlit/manager.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ def grant_privileges(self, entity_model: StreamlitEntityModel):
4545
if not entity_model.grants:
4646
return
4747
for grant in entity_model.grants:
48-
self.execute_query(grant.get_grant_sql(entity_model))
48+
# Use connection context to ensure proper database/schema qualification
49+
fqn_with_context = entity_model.fqn.using_connection(self._conn)
50+
grant_sql = f"GRANT {grant.privilege} ON {entity_model.get_type().upper()} {fqn_with_context.sql_identifier} TO ROLE {grant.role}"
51+
self.execute_query(grant_sql)
4952

5053
def get_url(self, streamlit_name: FQN) -> str:
5154
try:

0 commit comments

Comments
 (0)