Unable to give particular user access to a particular object in GCP bucket

39 Views Asked by At

Need to give access to a particular user to access a particular bucket object in gcp bucket storage.

Help with the IAM policy and what will be the steps for giving this permission.

I have tried with the various IAM policy and custom role policies...

I was expecting someone to help me in that to permit me to a particular user to access a particular bucket object in GCP.

1

There are 1 best solutions below

0
On

There are 2 ways to do it, one via cli, and another in UI.

  1. Cli command using gsutil gsutil iam ch user:[USER_EMAIL]:[ROLE] gs://[BUCKET_NAME]

    # Example for Storage Object Viewer
    gsutil iam ch user:[email protected]:roles/storage.objectViewer gs://your-bucket-name
    
  2. Grant access to principal (user) in the bucket by going to bucket > permissions > grant access enter image description here