Package fr.gouv.vitam.security.internal.filter

# Class EndpointPermissionAuthorizationFilter

java.lang.Object
fr.gouv.vitam.security.internal.filter.EndpointPermissionAuthorizationFilter

All Implemented Interfaces:
  `jakarta.ws.rs.container.ContainerRequestFilter`

public class EndpointPermissionAuthorizationFilter extends Object implements jakarta.ws.rs.container.ContainerRequestFilter
Handles permission based access authorization for REST endpoints.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `EndpointPermissionAuthorizationFilter(String permission)`
  Constructor with permission to filter
  `EndpointPermissionAuthorizationFilter(String permission, AdminManagementClient adminManagementClient)`
  Contructor for tests

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `filter(jakarta.ws.rs.container.ContainerRequestContext requestContext)`
  Checks authorization filter based of the current security profile permission set.
  `String`
  `getPermission()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### EndpointPermissionAuthorizationFilter

    public EndpointPermissionAuthorizationFilter(String permission)
    Constructor with permission to filter
    Parameters:
      `permission` - the permission to filter

  - ### EndpointPermissionAuthorizationFilter

    public EndpointPermissionAuthorizationFilter(String permission, AdminManagementClient adminManagementClient)
    Contructor for tests
    Parameters:
      `permission` -
      `adminManagementClient` -

- ## Method Details

  - ### filter

    public void filter(jakarta.ws.rs.container.ContainerRequestContext requestContext) throws IOException
    Checks authorization filter based of the current security profile permission set.
    Specified by:
      `filter` in interface `jakarta.ws.rs.container.ContainerRequestFilter`
    Parameters:
      `requestContext` - the invocation context
    Throws:
      `IOException`

  - ### getPermission

    public String getPermission()