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

****************
list_permissions
****************



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

  

  Lists the users and groups who have the Grafana ``Admin`` and ``Editor`` roles in this workspace. If you use this operation without specifying ``userId`` or ``groupId``, the operation returns the roles of all users and groups. If you specify a ``userId`` or a ``groupId``, only the roles for that user or group are returned. If you do this, you can specify only one ``userId`` or one ``groupId``.

  

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


  **Request Syntax**
  ::

    response = client.list_permissions(
        groupId='string',
        maxResults=123,
        nextToken='string',
        userId='string',
        userType='SSO_USER'|'SSO_GROUP',
        workspaceId='string'
    )
    
  :type groupId: string
  :param groupId: 

    (Optional) Limits the results to only the group that matches this ID.

    

  
  :type maxResults: integer
  :param maxResults: 

    The maximum number of results to include in the response.

    

  
  :type nextToken: string
  :param nextToken: 

    The token to use when requesting the next set of results. You received this token from a previous ``ListPermissions`` operation.

    

  
  :type userId: string
  :param userId: 

    (Optional) Limits the results to only the user that matches this ID.

    

  
  :type userType: string
  :param userType: 

    (Optional) If you specify ``SSO_USER``, then only the permissions of IAM Identity Center users are returned. If you specify ``SSO_GROUP``, only the permissions of IAM Identity Center groups are returned.

    

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

    The ID of the workspace to list permissions for. This parameter is required.

    

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

    
    ::

      {
          'nextToken': 'string',
          'permissions': [
              {
                  'role': 'ADMIN'|'EDITOR'|'VIEWER',
                  'user': {
                      'id': 'string',
                      'type': 'SSO_USER'|'SSO_GROUP'
                  }
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **nextToken** *(string) --* 

        The token to use in a subsequent ``ListPermissions`` operation to return the next set of results.

        
      

      - **permissions** *(list) --* 

        The permissions returned by the operation.

        
        

        - *(dict) --* 

          A structure containing the identity of one user or group and the ``Admin``, ``Editor``, or ``Viewer`` role that they have.

          
          

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

            Specifies whether the user or group has the ``Admin``, ``Editor``, or ``Viewer`` role.

            
          

          - **user** *(dict) --* 

            A structure with the ID of the user or group with this role.

            
            

            - **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.

              
        
      
    
  
  **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`

  