:doc:`ManagedGrafana <../../grafana>` / Client / update_permissions

******************
update_permissions
******************



.. py:method:: ManagedGrafana.Client.update_permissions(**kwargs)

  

  Updates which users in a workspace have the Grafana ``Admin`` or ``Editor`` roles.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/grafana-2020-08-18/UpdatePermissions>`_  


  **Request Syntax**
  ::

    response = client.update_permissions(
        updateInstructionBatch=[
            {
                'action': 'ADD'|'REVOKE',
                'role': 'ADMIN'|'EDITOR'|'VIEWER',
                'users': [
                    {
                        'id': 'string',
                        'type': 'SSO_USER'|'SSO_GROUP'
                    },
                ]
            },
        ],
        workspaceId='string'
    )
    
  :type updateInstructionBatch: list
  :param updateInstructionBatch: **[REQUIRED]** 

    An array of structures that contain the permission updates to make.

    

  
    - *(dict) --* 

      Contains the instructions for one Grafana role permission update in a `UpdatePermissions <https://docs.aws.amazon.com/grafana/latest/APIReference/API_UpdatePermissions.html>`__ operation.

      

    
      - **action** *(string) --* **[REQUIRED]** 

        Specifies whether this update is to add or revoke role permissions.

        

      
      - **role** *(string) --* **[REQUIRED]** 

        The role to add or revoke for the user or the group specified in ``users``.

        

      
      - **users** *(list) --* **[REQUIRED]** 

        A structure that specifies the user or group to add or revoke the role for.

        

      
        - *(dict) --* 

          A structure that specifies one user or group in the workspace.

          

        
          - **id** *(string) --* **[REQUIRED]** 

            The ID of the user or group.

             

            Pattern: ``^([0-9a-fA-F]{10}-|)[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}$``

            

          
          - **type** *(string) --* **[REQUIRED]** 

            Specifies whether this is a single user or a group.

            

          
        
    
    

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

    The ID of the workspace to update.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'errors': [
              {
                  'causedBy': {
                      'action': 'ADD'|'REVOKE',
                      'role': 'ADMIN'|'EDITOR'|'VIEWER',
                      'users': [
                          {
                              'id': 'string',
                              'type': 'SSO_USER'|'SSO_GROUP'
                          },
                      ]
                  },
                  'code': 123,
                  'message': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **errors** *(list) --* 

        An array of structures that contain the errors from the operation, if any.

        
        

        - *(dict) --* 

          A structure containing information about one error encountered while performing an `UpdatePermissions <https://docs.aws.amazon.com/grafana/latest/APIReference/API_UpdatePermissions.html>`__ operation.

          
          

          - **causedBy** *(dict) --* 

            Specifies which permission update caused the error.

            
            

            - **action** *(string) --* 

              Specifies whether this update is to add or revoke role permissions.

              
            

            - **role** *(string) --* 

              The role to add or revoke for the user or the group specified in ``users``.

              
            

            - **users** *(list) --* 

              A structure that specifies the user or group to add or revoke the role for.

              
              

              - *(dict) --* 

                A structure that specifies one user or group in the workspace.

                
                

                - **id** *(string) --* 

                  The ID of the user or group.

                   

                  Pattern: ``^([0-9a-fA-F]{10}-|)[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}$``

                  
                

                - **type** *(string) --* 

                  Specifies whether this is a single user or a group.

                  
            
          
        
          

          - **code** *(integer) --* 

            The error code.

            
          

          - **message** *(string) --* 

            The message for this error.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`ManagedGrafana.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`ManagedGrafana.Client.exceptions.ThrottlingException`

  
  *   :py:class:`ManagedGrafana.Client.exceptions.ValidationException`

  
  *   :py:class:`ManagedGrafana.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`ManagedGrafana.Client.exceptions.InternalServerException`

  