---
title: "Retrieve a list of admin rights"
url: "https://dev.developer-internal.sanofi.com/apis/plta-permissions-api-cbz/versions/88cdfef8-3b56-44ca-883d-5b15378e5a3a/operations/retrieveAdminRights"
---

> Full API specification: https://dev.developer-internal.sanofi.com/apis/plta-permissions-api-cbz/versions/88cdfef8-3b56-44ca-883d-5b15378e5a3a.md

# Retrieve a list of admin rights

`GET` `/users/{userId}/adminRights`

Operation ID: `retrieveAdminRights`

Allows the retrieval of all available admin rights of a specific user, held either directly or through role membership.

## Path parameters

- `userId` (string, required) - The ID of the user, as stored in IDP. For Sanofi internal users, it would be the oid (Unique identifier of the user in Azure AD)

## Responses

- `200` - Success
- `204` - Empty
- `401` - Unauthorized
- `403` - Forbidden
- `500` - Internal Server Error

## OpenAPI definition

```yaml
openapi: 3.1.0
info:
  title: Permission Administration API
  version: 1.5.0
servers:
  - url: https://dev.api.sanofi.com/permissions
paths:
  /users/{userId}/adminRights:
    parameters:
      - description: The ID of the user, as stored in IDP. For Sanofi internal users, it
          would be the oid (Unique identifier of the user in Azure AD)
        in: path
        name: userId
        required: true
        schema:
          type: string
    get:
      description: Allows the retrieval of all available admin rights of a specific
        user, held either directly or through role membership.
      operationId: retrieveAdminRights
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/SourcedAdminRight"
                type: array
          description: Success
        "204":
          description: Empty
        "401":
          $ref: "#/components/responses/401"
        "403":
          $ref: "#/components/responses/403"
        "500":
          $ref: "#/components/responses/500"
      summary: Retrieve a list of admin rights
      tags:
        - Admin Rights
security:
  - oauth: []
components:
  schemas:
    SourcedAdminRight:
      description: An admin right, tagged with where it comes from - held directly by
        the user, or inherited through membership of a role.
      properties:
        actionRestriction:
          description: Name of the action that restricts the action usable in this
            operation to a specific hierarchy. Absent if the operation is not
            restricted to a specific action.
          examples:
            - write_narrative
            - read_compound
          type: string
        adminRightId:
          description: The unique identifier of the underlying admin right, for use with
            DELETE /adminRights/{adminRightId}. Only present when source is
            "DIRECT" - a role-derived grant is deleted through DELETE
            /roles/{roleName}/adminGrants/{adminGrantId} instead, which is a
            different id.
          format: uuid
          readOnly: true
          type: string
        operationName:
          description: Name of the operation.
          examples:
            - manageActions
            - manageResources
            - manageAccessRights
            - manageRoles
          type: string
        resourceRestriction:
          description: Name of the resource that restricts the resource usable in this
            operation to a specific hierarchy. Absent if the operation is not
            restricted to a specific resource.
          examples:
            - compound_1245
            - study_1245
          type: string
        source:
          description: Where this admin right comes from. "DIRECT" if held directly by the
            user, or "ROLE#<roleName>" if inherited through membership of that
            role.
          examples:
            - DIRECT
            - ROLE#clintrials:study-reader
          readOnly: true
          type: string
        userId:
          description: The id of the user, as stored in IDP. For Sanofi internal user, it
            would be the oid (Unique identifier of the user in Azure AD). Always
            equal to the userId path parameter.
          readOnly: true
          type: string
      required:
        - operationName
        - userId
        - source
      type: object
    UnauthorizedError:
      properties:
        debugId:
          description: A unique request identifier for correlation purposes.
          example: 00-0af7651916cd43dd8448eb211c80319c-00f067aa0ba902b7-01
          type: string
        detail:
          description: Error detail
          enum:
            - You are not authorized to access this resource
          type: string
        status:
          description: HTTP status code
          enum:
            - 401
          type: number
        title:
          description: Human-readable identifier
          enum:
            - Unauthorized
          type: string
        type:
          description: URI that identifies the type of error that occurred
          example: https://backstage.prod.accelerator.sanofi/docs/default/component/sanofi-accelerator-api-rules/errors-unauthorized
          type: string
      required:
        - type
        - title
        - status
        - debugId
        - detail
      type: object
    ForbiddenError:
      properties:
        debugId:
          description: A unique request identifier for correlation purposes.
          example: 00-0af7651916cd43dd8448eb211c80319c-00f067aa0ba902b7-01
          type: string
        detail:
          description: Error detail
          enum:
            - You don't have the permission to access this resource
          type: string
        status:
          description: HTTP status code
          enum:
            - 403
          type: number
        title:
          description: Human-readable identifier
          enum:
            - Forbidden
          type: string
        type:
          description: URI that identifies the type of error that occurred
          example: https://backstage.prod.accelerator.sanofi/docs/default/component/sanofi-accelerator-api-rules/errors-forbidden
          type: string
      required:
        - type
        - title
        - status
        - debugId
        - detail
      type: object
    InternalServerError:
      description: Object describing the error format expected in API responses. Based
        on [RFC 9457](https://datatracker.ietf.org/doc/html/rfc9457)
      properties:
        debugId:
          description: A unique request identifier for correlation purposes. [Trace
            Context RFC](https://www.w3.org/TR/trace-context/)
          example: 00-0af7651916cd43dd8448eb211c80319c-00f067aa0ba902b7-01
          type: string
        detail:
          description: More information about the specific problem, and if it's
            appropriate also steps to correct it. For example information about
            a form validation problem
          example: The service is currently unavailable due to an unexpected error
          type: string
        status:
          description: HTTP status code
          example: 500
          type: number
        title:
          description: Human-readable identifier, usually the same type field should have
            the same title field
          example: Internal Server Error
          type: string
        type:
          description: URI that identifies the type of error that occured
          example: https://backstage.prod.accelerator.sanofi/docs/default/component/sanofi-accelerator-api-rules/errors-internal/
          type: string
      required:
        - type
        - title
        - status
        - debugId
        - detail
      type: object
  responses:
    "401":
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/UnauthorizedError"
      description: Unauthorized
    "403":
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ForbiddenError"
      description: Forbidden
    "500":
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/InternalServerError"
      description: Internal Server Error
  securitySchemes:
    oauth:
      bearerFormat: JWT
      scheme: bearer
      type: http
```
