Closed j450h1 closed 3 years ago
Does gar_service_provision()
work for you? If so then you should then have the permissions to list/assign roles.
If not are you authenticating with the email that is an Owner? This works with me:
library(googleAuthR)
# default for json using Sys.getenv("GAR_CLIENT_JSON")
gar_set_client(scopes = "https://www.googleapis.com/auth/cloud-platform")
gar_auth()
gar_service_create("test12345678", "my_project")
I can see my roles to help with your roles ;) - I only have user:
gar_service_get_roles("my-project", accountId = "my@email.com", type = "user")
#ℹ 2021-02-06 18:31:37 > Checking existing roles
# roles members
#1 roles/owner user:my@email.com
If still not working, will have to think - perhaps the client.id for the JSON is restricted to certain scopes when set up?
Thanks for your help. I figured out the root cause. Everything works now as expected.
The key was to set GAR_CLIENT_JSON as an environment variable in .Renviron file and restarting session of course. The way I had originally setup with client id using gar_set_client()
wasn't the way to do things.
I'm a Project Owner and Service Account Admin for this GCP project. Any clue where I'm going wrong?
OUTPUT: