Class AccountRoleEndpoint


  • @FrameworkRestController
    @FrameworkMapping("/account-roles")
    @DataRouteByExample(AccountRole.class)
    public class AccountRoleEndpoint
    extends Object
    Endpoints for CRUD operations on AccountRole.

    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), Chris Kittrell (ckittrell)
    • Method Detail

      • readAllRoles

        @FrameworkGetMapping
        @Policy(permissionRoots="ACCOUNT_ROLE")
        public org.springframework.data.domain.Page<AccountRole> 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("/{roleId}")
        @Policy(permissionRoots="ACCOUNT_ROLE")
        public AccountRole getRole​(@PathVariable("roleId")
                                   String roleId,
                                   @ContextOperation(READ)
                                   com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      • createRole

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

        @FrameworkPutMapping("/{roleId}")
        @Policy(permissionRoots="ACCOUNT_ROLE")
        public AccountRole replaceRole​(@PathVariable("roleId")
                                       String roleId,
                                       @RequestBody
                                       AccountRole role,
                                       @ContextOperation(UPDATE)
                                       com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      • deleteRole

        @FrameworkDeleteMapping("/{roleId}")
        @Policy(permissionRoots="ACCOUNT_ROLE")
        public void deleteRole​(@PathVariable("roleId")
                               String roleId,
                               @ContextOperation(DELETE)
                               com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      • logDebug

        protected void logDebug​(Exception ex,
                                org.springframework.web.context.request.WebRequest request)