Class DefaultCatalogVersionPermissionService
java.lang.Object
de.hybris.platform.cmsfacades.catalogversions.service.impl.DefaultCatalogVersionPermissionService
- All Implemented Interfaces:
CatalogVersionPermissionService
public class DefaultCatalogVersionPermissionService
extends Object
implements CatalogVersionPermissionService
Verifies that the current user has read or write access for a given catalog version according to the requested CRUD
operation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CatalogVersionServiceprotected UserServicebooleanhasPermission(String requestMethod, javax.servlet.http.HttpServletResponse response, String catalog, 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.voidsetCatalogVersionService(CatalogVersionService catalogVersionService) voidsetUserService(UserService userService)
-
Constructor Details
-
DefaultCatalogVersionPermissionService
public DefaultCatalogVersionPermissionService()
-
-
Method Details
-
hasPermission
public boolean hasPermission(String requestMethod, javax.servlet.http.HttpServletResponse response, String catalog, String catalogVersion) throws 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 statusHttpStatus#FORBIDDENis returned.In the case that the user does not have permission, an error in the HTTP response using the status code
403 - Forbiddenis returned.- Specified by:
hasPermissionin interfaceCatalogVersionPermissionService- Parameters:
requestMethod- the HTTP request method: GET, PUT, POST or DELETEresponse- the HTTP servlet response containing the error message if the user does not have access to the requested catalog versioncatalog- the catalog identifiercatalogVersion- the catalog version identifier- Returns:
truewhen the current user has read or write permission to the given catalog version or is an anonymous user;falseotherwise.- Throws:
IOException- when an error occurs while raising the error
-
getCatalogVersionService
-
setCatalogVersionService
-
getUserService
-
setUserService
-