> ## Documentation Index
> Fetch the complete documentation index at: https://docs.diversion.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# List granular permissions

> List all granular permissions configured for this repository



## OpenAPI

````yaml get /repos/{repo_id}/granular-permissions
openapi: 3.0.3
info:
  title: Diversion Core API
  description: >-
    Definition of the Core API used to access low-level functionality of
    Diversion
  version: 0.2.0
servers:
  - url: https://api.diversion.dev/v0
    description: Base endpoint
security: []
paths:
  /repos/{repo_id}/granular-permissions:
    parameters:
      - $ref: '#/components/parameters/RepoParam'
    get:
      tags:
        - Repository Granular Permissions
      summary: List granular permissions
      description: List all granular permissions configured for this repository
      operationId: src.handlersv2.path_permission.list_permissions
      parameters:
        - in: query
          name: user_id
          schema:
            type: string
          description: Filter by user ID
        - in: query
          name: group_id
          schema:
            type: string
          description: Filter by group ID
      responses:
        '200':
          $ref: '#/components/responses/GranularPermissionList'
        '400':
          description: Invalid filter parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
      security:
        - OAuth2:
            - coreapi/read
        - OAuth2:
            - coreapi/write
components:
  parameters:
    RepoParam:
      in: path
      name: repo_id
      required: true
      schema:
        type: string
        example: example_id
        minLength: 3
        maxLength: 128
      description: >-
        The repo ID of the repository. Repo _name_ can be used instead of the
        ID, but usage of ID for permanent linking and API requests is preferred.
  responses:
    GranularPermissionList:
      description: A list of granular permission objects
      content:
        application/json:
          schema:
            type: object
            properties:
              items:
                type: array
                items:
                  $ref: '#/components/schemas/GranularPermission'
            required:
              - items
    Error:
      description: An error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        status:
          type: integer
          description: HTTP status code
        detail:
          type: string
        title:
          type: string
        type:
          type: string
      required:
        - status
        - detail
    GranularPermission:
      type: object
      properties:
        id:
          description: Granular permission identifier
          type: string
        repo_id:
          description: Repository ID this permission belongs to
          type: string
        user_id:
          description: User ID this permission is assigned to
          type: string
        group_id:
          description: Group ID this permission is assigned to
          type: string
        path_pattern:
          description: Path pattern for matching files
          type: string
        access_level:
          $ref: '#/components/schemas/PathAccessLevel'
        permission_type:
          $ref: '#/components/schemas/GranularPermissionType'
        evaluation_order:
          description: >-
            Rule evaluation priority. Higher values are evaluated first
            (read-only).
          type: integer
        created_unix:
          description: Creation timestamp (Unix epoch)
          type: integer
          format: int64
        updated_unix:
          description: Last update timestamp (Unix epoch)
          type: integer
          format: int64
        created_by:
          description: User ID who created this permission
          type: string
        last_updated_by:
          description: User ID who last updated this permission
          type: string
      required:
        - id
        - repo_id
        - path_pattern
        - access_level
        - permission_type
        - evaluation_order
        - created_unix
        - updated_unix
        - created_by
        - last_updated_by
    PathAccessLevel:
      type: string
      enum:
        - ADMIN
        - WRITE
        - READ
        - NO_ACCESS
      description: >-
        Access level for path permissions. Hierarchical: ADMIN > WRITE > READ >
        NO_ACCESS.
    GranularPermissionType:
      type: string
      enum:
        - ALLOW_LT_EQ
        - ALLOW_EQ
        - DENY_ALL
        - DENY_EQ
      description: >-
        Permission type controlling how access levels are granted or denied.
        ALLOW_LT_EQ grants specified level and all lower levels. ALLOW_EQ grants
        only the exact level. DENY_ALL denies all level granted above in the
        table. DENY_EQ denies only the exact level.
  securitySchemes:
    OAuth2:
      type: oauth2
      x-tokenInfoFunc: src.token_info.token_auth
      description: This API uses OAuth 2 with the implicit grant flow
      flows:
        implicit:
          authorizationUrl: https://auth.diversion.dev/oauth2/authorize
          scopes:
            coreapi/read: Operations with no possible side-effects
            coreapi/write: Modifying operations
            coreapi/admin: >-
              Organizational operations like adding a repo or changing repo
              properties

````