Documentation

Permissions extends Resource
in package

The "permissions" collection of methods.

Typical usage is: $driveService = new Google\Service\Drive(...); $permissions = $driveService->permissions;

Table of Contents

Properties

$client  : Client
$methods  : array<string|int, mixed>
$resourceName  : string
$rootUrl  : string
$serviceName  : string
$servicePath  : string
$stackParameters  : mixed

Methods

__construct()  : mixed
call()  : mixed
TODO: This function needs simplifying.
create()  : Permission
Creates a permission for a file or shared drive. (permissions.create)
createRequestUri()  : string
Parse/expand request parameters and create a fully qualified request uri.
delete()  : mixed
Deletes a permission. (permissions.delete)
get()  : Permission
Gets a permission by ID. (permissions.get)
listPermissions()  : PermissionList
Lists a file's or shared drive's permissions. (permissions.listPermissions)
update()  : Permission
Updates a permission with patch semantics. (permissions.update)
convertToArrayAndStripNulls()  : mixed

Properties

$methods

private array<string|int, mixed> $methods

$resourceName

private string $resourceName

$serviceName

private string $serviceName

$servicePath

private string $servicePath

$stackParameters

private mixed $stackParameters = array('alt' => array('type' => 'string', 'location' => 'query'), 'fields' => array('type' => 'string', 'location' => 'query'), 'trace' => array('type' => 'string', 'location' => 'query'), 'userIp' => array('type' => 'string', 'location' => 'query'), 'quotaUser' => array('type' => 'string', 'location' => 'query'), 'data' => array('type' => 'string', 'location' => 'body'), 'mimeType' => array('type' => 'string', 'location' => 'header'), 'uploadType' => array('type' => 'string', 'location' => 'query'), 'mediaUpload' => array('type' => 'complex', 'location' => 'query'), 'prettyPrint' => array('type' => 'string', 'location' => 'query'))

Methods

__construct()

public __construct(mixed $service, mixed $serviceName, mixed $resourceName, mixed $resource) : mixed
Parameters
$service : mixed
$serviceName : mixed
$resourceName : mixed
$resource : mixed

call()

TODO: This function needs simplifying.

public call(mixed $name, mixed $arguments[, mixed $expectedClass = null ]) : mixed
Parameters
$name : mixed
$arguments : mixed
$expectedClass : mixed = null
  • optional, the expected class name
Tags
@return

Request|$expectedClass

throws
Exception

create()

Creates a permission for a file or shared drive. (permissions.create)

public create(string $fileId, Permission $postBody[, array<string|int, mixed> $optParams = [] ]) : Permission
Parameters
$fileId : string

The ID of the file or shared drive.

$postBody : Permission
$optParams : array<string|int, mixed> = []

Optional parameters.

Tags
opt_param

string emailMessage A plain text custom message to include in the notification email.

opt_param

bool enforceSingleParent Deprecated. See moveToNewOwnersRoot for details.

opt_param

bool moveToNewOwnersRoot This parameter will only take effect if the item is not in a shared drive and the request is attempting to transfer the ownership of the item. If set to true, the item will be moved to the new owner's My Drive root folder and all prior parents removed. If set to false, parents are not changed.

opt_param

bool sendNotificationEmail Whether to send a notification email when sharing to users or groups. This defaults to true for users and groups, and is not allowed for other requests. It must not be disabled for ownership transfers.

opt_param

bool supportsAllDrives Whether the requesting application supports both My Drives and shared drives.

opt_param

bool supportsTeamDrives Deprecated use supportsAllDrives instead.

opt_param

bool transferOwnership Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect. File owners can only transfer ownership of files existing on My Drive. Files existing in a shared drive are owned by the organization that owns that shared drive. Ownership transfers are not supported for files and folders in shared drives. Organizers of a shared drive can move items from that shared drive into their My Drive which transfers the ownership to them.

opt_param

bool useDomainAdminAccess Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.

Return values
Permission

createRequestUri()

Parse/expand request parameters and create a fully qualified request uri.

public createRequestUri(string $restPath, array<string|int, mixed> $params) : string
Parameters
$restPath : string
$params : array<string|int, mixed>
Tags
static
Return values
string

$requestUrl

delete()

Deletes a permission. (permissions.delete)

public delete(string $fileId, string $permissionId[, array<string|int, mixed> $optParams = [] ]) : mixed
Parameters
$fileId : string

The ID of the file or shared drive.

$permissionId : string

The ID of the permission.

$optParams : array<string|int, mixed> = []

Optional parameters.

Tags
opt_param

bool supportsAllDrives Whether the requesting application supports both My Drives and shared drives.

opt_param

bool supportsTeamDrives Deprecated use supportsAllDrives instead.

opt_param

bool useDomainAdminAccess Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.

get()

Gets a permission by ID. (permissions.get)

public get(string $fileId, string $permissionId[, array<string|int, mixed> $optParams = [] ]) : Permission
Parameters
$fileId : string

The ID of the file.

$permissionId : string

The ID of the permission.

$optParams : array<string|int, mixed> = []

Optional parameters.

Tags
opt_param

bool supportsAllDrives Whether the requesting application supports both My Drives and shared drives.

opt_param

bool supportsTeamDrives Deprecated use supportsAllDrives instead.

opt_param

bool useDomainAdminAccess Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.

Return values
Permission

listPermissions()

Lists a file's or shared drive's permissions. (permissions.listPermissions)

public listPermissions(string $fileId[, array<string|int, mixed> $optParams = [] ]) : PermissionList
Parameters
$fileId : string

The ID of the file or shared drive.

$optParams : array<string|int, mixed> = []

Optional parameters.

Tags
opt_param

string includePermissionsForView Specifies which additional view's permissions to include in the response. Only 'published' is supported.

opt_param

int pageSize The maximum number of permissions to return per page. When not set for files in a shared drive, at most 100 results will be returned. When not set for files that are not in a shared drive, the entire list will be returned.

opt_param

string pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.

opt_param

bool supportsAllDrives Whether the requesting application supports both My Drives and shared drives.

opt_param

bool supportsTeamDrives Deprecated use supportsAllDrives instead.

opt_param

bool useDomainAdminAccess Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.

Return values
PermissionList

update()

Updates a permission with patch semantics. (permissions.update)

public update(string $fileId, string $permissionId, Permission $postBody[, array<string|int, mixed> $optParams = [] ]) : Permission
Parameters
$fileId : string

The ID of the file or shared drive.

$permissionId : string

The ID of the permission.

$postBody : Permission
$optParams : array<string|int, mixed> = []

Optional parameters.

Tags
opt_param

bool removeExpiration Whether to remove the expiration date.

opt_param

bool supportsAllDrives Whether the requesting application supports both My Drives and shared drives.

opt_param

bool supportsTeamDrives Deprecated use supportsAllDrives instead.

opt_param

bool transferOwnership Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect. File owners can only transfer ownership of files existing on My Drive. Files existing in a shared drive are owned by the organization that owns that shared drive. Ownership transfers are not supported for files and folders in shared drives. Organizers of a shared drive can move items from that shared drive into their My Drive which transfers the ownership to them.

opt_param

bool useDomainAdminAccess Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.

Return values
Permission

convertToArrayAndStripNulls()

protected convertToArrayAndStripNulls(mixed $o) : mixed
Parameters
$o : mixed

        
On this page

Search results