Skip to content

Commit

Permalink
add revoke doc and fix messages (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
hirosassa authored Apr 9, 2022
1 parent ac2c292 commit d902758
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Currently supports;

- list the user's permissions for each BigQuery Datasets
- permit users to each BigQuery Datasets access role (READER/WRITER/OWNER) and `roles/bigquery.jobUser` (to run query)
- permit users to Project-wide access role (`roles/viewer` or `rolse/editor`)

- permit users to Project-wide access role (`roles/viewer` or `rolse/editor`)
- revoke users' datasets and/or project-wide permissions

## Requirement

Expand Down Expand Up @@ -71,6 +71,17 @@ Permit user2@email.com to bq-project-id access as READER

```

Revoke the user(s)' access permissions.
```bash
$ bqiam revoke dataset READER -p bq-project-id -u user1@email.com -d dataset1
Revoked user1@email.com's permission of dataset1 access as READER
$ bqiam project READER -p bq-project-id -u user1@email.com -u user2@email.com
Revoked user1@email.com's permission of bq-project-id access as READER
Revoked user2@email.com's permission of bq-project-id access as READER
```
## Completion
Completion is available for bash or zsh.
Download projects, datasets, users list data via GCP API.
Expand Down
2 changes: 1 addition & 1 deletion bqrole/dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func RevokeDataset(role bq.AccessRole, project string, users, datasets []string,
return err
}
}
fmt.Printf("Revoke %s to %s access as %s\n", user, dataset, role)
fmt.Printf("Revoked %s's permission of %s access as %s\n", user, dataset, role)
}
}

Expand Down
2 changes: 1 addition & 1 deletion bqrole/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func RevokeProject(role, project string, users []string, yes bool) error {
if err != nil {
return err
}
fmt.Printf("Revoke %s to %s access as %s\n", user, project, role)
fmt.Printf("Revoked %s's permission of %s access as %s\n", user, project, role)
}

return nil
Expand Down

0 comments on commit d902758

Please sign in to comment.