Codify permissions list for Google Drive files.
- Create a service account
- Invite the service account to the files you want to codify
- Download the service account's credentials (e.g.
credentials.json
)
Create the permissions.yml
file:
version: 1
permissions:
- fileId: 'foobar'
resource:
- type: 'user'
role: 'owner'
emailAddress: 'foo@example.com'
- type: 'user'
role: 'writer'
emailAddress: 'gdrivepermissionscodify@foo.iam.gserviceaccount.com'
Run gdrive-permissions-codify
:
gdrive-permissions-codify --permission-file ./permissions.yml --credential-file ./credentials.json
See gdrive-permissions-codify --help
for the CLI options.
Add a new resource at permissions[].resource
:
permissions:
- fileId: 'foo-bar-123'
resource:
+ - type: 'user'
+ role: 'owner'
+ emailAddress: 'foo@example.com'
role should be one of the following avlues:
- owner
- organizer
- fileOrganizer
- writer
- commenter
- reader
Please have a look at https://developers.google.com/drive/api/v3/reference/permissions for more details.
permissions:
- fileId: 'foo-bar-123'
resource:
- type: 'user'
- role: 'owner'
+ role: 'viewer'
emailAddress: 'foo@example.com'
Simply delete the associated resource from the file.
permissions:
- fileId: 'foo-bar-123'
resource:
- - type: 'user'
- role: 'owner'
- emailAddress: 'foo@example.com'
When you bump up the version
in package.json
and push to master
branch, the package will be updated to the private GitHub Packages automatically. You cannot publish to same versions.