add_resource_permissions

add_resource_permissions(**kwargs)

Creates a set of permissions for the specified folder or document. The resource permissions are overwritten if the principals already have different permissions.

See also: AWS API Documentation

Request Syntax

response = client.add_resource_permissions(
    AuthenticationToken='string',
    ResourceId='string',
    Principals=[
        {
            'Id': 'string',
            'Type': 'USER'|'GROUP'|'INVITE'|'ANONYMOUS'|'ORGANIZATION',
            'Role': 'VIEWER'|'CONTRIBUTOR'|'OWNER'|'COOWNER'
        },
    ],
    NotificationOptions={
        'SendEmail': True|False,
        'EmailMessage': 'string'
    }
)
Parameters
  • AuthenticationToken (string) -- Amazon WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to access the API.
  • ResourceId (string) --

    [REQUIRED]

    The ID of the resource.

  • Principals (list) --

    [REQUIRED]

    The users, groups, or organization being granted permission.

    • (dict) --

      Describes the recipient type and ID, if available.

      • Id (string) -- [REQUIRED]

        The ID of the recipient.

      • Type (string) -- [REQUIRED]

        The type of the recipient.

      • Role (string) -- [REQUIRED]

        The role of the recipient.

  • NotificationOptions (dict) --

    The notification options.

    • SendEmail (boolean) --

      Boolean value to indicate an email notification should be sent to the recipients.

    • EmailMessage (string) --

      Text value to be included in the email body.

Return type

dict

Returns

Response Syntax

{
    'ShareResults': [
        {
            'PrincipalId': 'string',
            'InviteePrincipalId': 'string',
            'Role': 'VIEWER'|'CONTRIBUTOR'|'OWNER'|'COOWNER',
            'Status': 'SUCCESS'|'FAILURE',
            'ShareId': 'string',
            'StatusMessage': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • ShareResults (list) --

      The share results.

      • (dict) --

        Describes the share results of a resource.

        • PrincipalId (string) --

          The ID of the principal.

        • InviteePrincipalId (string) --

          The ID of the invited user.

        • Role (string) --

          The role.

        • Status (string) --

          The status.

        • ShareId (string) --

          The ID of the resource that was shared.

        • StatusMessage (string) --

          The status message.

Exceptions

  • WorkDocs.Client.exceptions.UnauthorizedOperationException
  • WorkDocs.Client.exceptions.UnauthorizedResourceAccessException
  • WorkDocs.Client.exceptions.FailedDependencyException
  • WorkDocs.Client.exceptions.ServiceUnavailableException
  • WorkDocs.Client.exceptions.ProhibitedStateException