chetan gowda
chetan gowda

Reputation: 11

I have granted usage permission on db,schema,stage,storage intergation to new role but he is not able to list/desc the stage

Use database citibike;
use warehouse COMPUTE_WH;
use role ACCOUNTADMIN;

list @citibike_trips; -- external stage with storage integration

CREATE USER USER1 PASSWORD='abc123';
CREATE role BasicRole;

----------granting access to user role

show grants on stage citibike_trips;  -- sysadmin owner
grant usage on stage citibike_trips to role BasicRole; -- grants  usage stage to new role
grant usage on database citibike to role BasicRole;
grant usage on warehouse COMPUTE_WH to role BasicRole;
grant usage on schema public to role BasicRole;
grant usage on table TRIPS to role BasicRole;

----accountadmin has created the storage integration and grant access is given to role Basic Role

----------checking grants

show grants on stage citibike_trips;  -- 1) sysadmin owner 2) usage BasicRole
show grants on warehouse COMPUTE_WH; 

grant role BasicRole to USER USER1;

------------when user user1 is logging in with user id and listing stage he is unable to list

USE ROLE BasicRole;
USE DATABASE citibike;
USE WAREHOUSE COMPUTE_WH;

list @citibike_trips;

Upvotes: 1

Views: 1909

Answers (2)

Xarioth
Xarioth

Reputation: 11

Just in case anyone stumbles across this like I just did a few minutes ago, and because there is no answer, here's what I found myself.

Usage, while it executes successfully, isn't actually a privilege for stages, those privileges are "READ", "WRITE", "SERVICE READ", and "SERVICE WRITE".

What you may need to grant in your scenario is "READ" access.

so instead of:

grant usage on stage citibike_trips to role BasicRole;

Use:

grant READ on stage citibike_trips to role BasicRole;

Upvotes: 0

Md Aurangzeb
Md Aurangzeb

Reputation: 51

I believe you are referring to AWS S3 external stage access, Correct? What is the error? Have you followed the configuration steps mentioned here- https://docs.snowflake.com/en/user-guide/data-load-s3-config-storage-integration.html

Upvotes: 1

Related Questions