Interface CatalogVersionPermissionService

  • All Known Implementing Classes:
    DefaultCatalogVersionPermissionService

    public interface CatalogVersionPermissionService
    Service to verify if the current session user has read or write permission for a catalog version which matches the request HTTP CRUD operation.
    • A GET request requires at least a read permission for a catalog version.
    • A POST, PUT and DELETE request requires at least a write permission for a catalog version.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean hasPermission​(java.lang.String requestMethod, javax.servlet.http.HttpServletResponse response, java.lang.String catalog, java.lang.String catalogVersion)
      Determines if the current user has read or write permission to the catalog version for an operation given by the request's HTTP method.
    • Method Detail

      • hasPermission

        boolean hasPermission​(java.lang.String requestMethod,
                              javax.servlet.http.HttpServletResponse response,
                              java.lang.String catalog,
                              java.lang.String catalogVersion)
                       throws java.io.IOException
        Determines if the current user has read or write permission to the catalog version for an operation given by the request's HTTP method. In the case that the user does not have permission, an error in the HTTP response with the status HttpStatus#FORBIDDEN is returned.
        Parameters:
        requestMethod - the HTTP request method: GET, PUT, POST or DELETE
        response - the HTTP servlet response containing the error message if the user does not have access to the requested catalog version
        catalog - the catalog identifier
        catalogVersion - the catalog version identifier
        Returns:
        true when the current user has read or write permission to the given catalog version or is an anonymous user; false otherwise.
        Throws:
        java.io.IOException - when an error occurs while raising the error