:doc:`WorkDocs <../../workdocs>` / Client / add_resource_permissions

************************
add_resource_permissions
************************



.. py:method:: WorkDocs.Client.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 <https://docs.aws.amazon.com/goto/WebAPI/workdocs-2016-05-01/AddResourcePermissions>`_  


  **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'
        }
    )
    
  :type AuthenticationToken: string
  :param AuthenticationToken: 

    Amazon WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to access the API.

    

  
  :type ResourceId: string
  :param ResourceId: **[REQUIRED]** 

    The ID of the resource.

    

  
  :type Principals: list
  :param Principals: **[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.

        

      
    

  :type NotificationOptions: dict
  :param NotificationOptions: 

    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.

      

    
  
  
  :rtype: 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**
  
  *   :py:class:`WorkDocs.Client.exceptions.UnauthorizedOperationException`

  
  *   :py:class:`WorkDocs.Client.exceptions.UnauthorizedResourceAccessException`

  
  *   :py:class:`WorkDocs.Client.exceptions.FailedDependencyException`

  
  *   :py:class:`WorkDocs.Client.exceptions.ServiceUnavailableException`

  
  *   :py:class:`WorkDocs.Client.exceptions.ProhibitedStateException`

  