Class AdminRoleEndpoint
java.lang.Object
com.broadleafcommerce.adminuser.resource.web.endpoint.AdminRoleEndpoint
@FrameworkRestController
@FrameworkMapping("/roles")
@DataRouteByExample(AdminUser.class)
@ConditionalOnBean(AdminRoleService.class)
public class AdminRoleEndpoint
extends Object
Endpoints for CRUD operations on
AdminRole
.
Access control for these operations are based on tenant context for each endpoint.
Global roles can be read in any context, but are immutable in all but the global context.
All other roles can be read/modified in the global context or the tenant context the role is assigned to. Tenant-level users can only create/modify roles from their tenant.
- Author:
- Samarth Dhruva (samarthd)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateRole
(AdminRole role, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) void
deleteRole
(String id, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected AdminRoleService<AdminRole>
org.springframework.http.ResponseEntity<com.broadleafcommerce.common.error.ApiError>
handleInvalidAdminRoleDeleteException
(InvalidAdminRoleDeleteException ex, org.springframework.web.context.request.WebRequest request) protected void
org.springframework.data.domain.Page<AdminRole>
readAllRoles
(String name, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) replaceRole
(String id, AdminRole role, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
Constructor Details
-
AdminRoleEndpoint
-
-
Method Details
-
readAllRoles
@FrameworkGetMapping @Policy(permissionRoots="ADMIN_ROLE") public org.springframework.data.domain.Page<AdminRole> readAllRoles(@RequestParam(value="q",required=false) String name, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getRole
-
createRole
-
replaceRole
-
deleteRole
@FrameworkDeleteMapping("/{id}") @Policy(permissionRoots="ADMIN_ROLE") public void deleteRole(@PathVariable("id") String id, @ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
handleInvalidAdminRoleDeleteException
@ExceptionHandler(InvalidAdminRoleDeleteException.class) public org.springframework.http.ResponseEntity<com.broadleafcommerce.common.error.ApiError> handleInvalidAdminRoleDeleteException(InvalidAdminRoleDeleteException ex, org.springframework.web.context.request.WebRequest request) -
logDebug
-
getAdminRoleService
-