Skip to main content

permissions

Creates, updates, deletes, gets or lists a permissions resource.

Overview

Namepermissions
TypeResource
Idgoogleworkspace.drivelabelsv2beta.permissions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringResource name of this permission.
audiencestringAudience to grant a role to. The magic value of audiences/default may be used to apply the role to the default audience in the context of the organization that owns the label.
emailstringSpecifies the email address for a user or group principal. Not populated for audience principals. User and group permissions may only be inserted using an email address. On update requests, if email address is specified, no principal should be specified.
groupstringGroup resource name.
personstringPerson resource name.
rolestringThe role the principal should have.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectlabelsId, revisionsIduseAdminAccess, pageSize, pageTokenLists a label's permissions.
createinsertlabelsId, revisionsIduseAdminAccessUpdates a label's permissions. If a permission for the indicated principal doesn't exist, a label permission is created, otherwise the existing permission is updated. Permissions affect the label resource as a whole, aren't revisioned, and don't require publishing.
batch_updateupdatelabelsId, revisionsIdUpdates label permissions. If a permission for the indicated principal doesn't exist, a label permission is created, otherwise the existing permission is updated. Permissions affect the label resource as a whole, aren't revisioned, and don't require publishing.
deletedeletelabelsId, revisionsId, permissionsIduseAdminAccessDeletes a label's permission. Permissions affect the label resource as a whole, aren't revisioned, and don't require publishing.
batch_deletedeletelabelsId, revisionsIdDeletes label permissions. Permissions affect the label resource as a whole, aren't revisioned, and don't require publishing.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
labelsIdstring
permissionsIdstring
revisionsIdstring
pageSizeinteger (int32)
pageTokenstring
useAdminAccessboolean

SELECT examples

Lists a label's permissions.

SELECT
name,
audience,
email,
group,
person,
role
FROM googleworkspace.drivelabelsv2beta.permissions
WHERE labelsId = '{{ labelsId }}' -- required
AND revisionsId = '{{ revisionsId }}' -- required
AND useAdminAccess = '{{ useAdminAccess }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
;

INSERT examples

Updates a label's permissions. If a permission for the indicated principal doesn't exist, a label permission is created, otherwise the existing permission is updated. Permissions affect the label resource as a whole, aren't revisioned, and don't require publishing.

INSERT INTO googleworkspace.drivelabelsv2beta.permissions (
data__person,
data__group,
data__audience,
data__name,
data__email,
data__role,
labelsId,
revisionsId,
useAdminAccess
)
SELECT
'{{ person }}',
'{{ group }}',
'{{ audience }}',
'{{ name }}',
'{{ email }}',
'{{ role }}',
'{{ labelsId }}',
'{{ revisionsId }}',
'{{ useAdminAccess }}'
RETURNING
name,
audience,
email,
group,
person,
role
;

UPDATE examples

Updates label permissions. If a permission for the indicated principal doesn't exist, a label permission is created, otherwise the existing permission is updated. Permissions affect the label resource as a whole, aren't revisioned, and don't require publishing.

UPDATE googleworkspace.drivelabelsv2beta.permissions
SET
data__requests = '{{ requests }}',
data__useAdminAccess = {{ useAdminAccess }}
WHERE
labelsId = '{{ labelsId }}' --required
AND revisionsId = '{{ revisionsId }}' --required
RETURNING
permissions;

DELETE examples

Deletes a label's permission. Permissions affect the label resource as a whole, aren't revisioned, and don't require publishing.

DELETE FROM googleworkspace.drivelabelsv2beta.permissions
WHERE labelsId = '{{ labelsId }}' --required
AND revisionsId = '{{ revisionsId }}' --required
AND permissionsId = '{{ permissionsId }}' --required
AND useAdminAccess = '{{ useAdminAccess }}'
;