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 Details

  • 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

      @FrameworkGetMapping("/{id}") @Policy(permissionRoots="ADMIN_ROLE") public AdminRole getRole(@PathVariable("id") String id, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • createRole

      @FrameworkPostMapping @Policy(permissionRoots="ADMIN_ROLE") public AdminRole createRole(@RequestBody AdminRole role, @ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • replaceRole

      @FrameworkPutMapping("/{id}") @Policy(permissionRoots="ADMIN_ROLE") public AdminRole replaceRole(@PathVariable("id") String id, @RequestBody AdminRole role, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • 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)
      See Also:
    • logDebug

      @Deprecated(forRemoval=true) protected void logDebug(Exception ex, org.springframework.web.context.request.WebRequest request)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Deprecated in favor of central logging managed by ExceptionHandlerUtils.
    • getAdminRoleService

      @NonNull protected AdminRoleService<AdminRole> getAdminRoleService()
    • getExceptionHandlerUtils

      protected com.broadleafcommerce.common.error.validation.web.ExceptionHandlerUtils getExceptionHandlerUtils()
    • setExceptionHandlerUtils

      @Autowired public void setExceptionHandlerUtils(com.broadleafcommerce.common.error.validation.web.ExceptionHandlerUtils exceptionHandlerUtils)