Class AccessIdController

java.lang.Object
pro.taskana.common.rest.AccessIdController

@RestController @EnableHypermediaSupport(type=HAL) public class AccessIdController extends Object
Controller for Access Id validation.
  • Constructor Details

    • AccessIdController

      @Autowired public AccessIdController(LdapClient ldapClient, pro.taskana.common.api.TaskanaEngine taskanaEngine)
  • Method Details

    • searchUsersAndGroups

      @GetMapping(path="/api/v1/access-ids") public org.springframework.http.ResponseEntity<List<AccessIdRepresentationModel>> searchUsersAndGroups(@RequestParam("search-for") String searchFor) throws pro.taskana.common.api.exceptions.InvalidArgumentException, pro.taskana.common.api.exceptions.NotAuthorizedException
      This endpoint searches a provided access Id in the configured ldap.
      Parameters:
      searchFor - the Access Id which should be searched for.
      Returns:
      a list of all found Access Ids
      Throws:
      pro.taskana.common.api.exceptions.InvalidArgumentException - if the provided search for Access Id is shorter than the configured one.
      pro.taskana.common.api.exceptions.NotAuthorizedException - if the current user is not ADMIN or BUSINESS_ADMIN.
    • searchUsersByNameOrAccessIdForRole

      @GetMapping(path="/api/v1/access-ids/with-name") public org.springframework.http.ResponseEntity<List<AccessIdRepresentationModel>> searchUsersByNameOrAccessIdForRole(@RequestParam("search-for") String nameOrAccessId, @RequestParam("role") String role) throws pro.taskana.common.api.exceptions.InvalidArgumentException, pro.taskana.common.api.exceptions.NotAuthorizedException
      This endpoint searches AccessIds for a provided name or Access Id. It will only search and return users and members of groups which are configured with the requested TASKANA role. This search will only work if the users in the configured LDAP have an attribute that shows their group memberships, e.g. "memberOf"
      Parameters:
      nameOrAccessId - the name or Access Id which should be searched for.
      role - the role for which all users should be searched for
      Returns:
      a list of all found Access Ids (users)
      Throws:
      pro.taskana.common.api.exceptions.InvalidArgumentException - if the provided search for Access Id is shorter than the configured one.
      pro.taskana.common.api.exceptions.NotAuthorizedException - if the current user is not member of role USER, BUSINESS_ADMIN or ADMIN
    • getGroupsByAccessId

      @GetMapping(path="/api/v1/access-ids/groups") public org.springframework.http.ResponseEntity<List<AccessIdRepresentationModel>> getGroupsByAccessId(@RequestParam("access-id") String accessId) throws pro.taskana.common.api.exceptions.InvalidArgumentException, pro.taskana.common.api.exceptions.NotAuthorizedException
      This endpoint retrieves all groups a given Access Id belongs to.
      Parameters:
      accessId - the Access Id whose groups should be determined.
      Returns:
      a list of the group Access Ids the requested Access Id belongs to
      Throws:
      pro.taskana.common.api.exceptions.InvalidArgumentException - if the requested Access Id does not exist or is not unique.
      pro.taskana.common.api.exceptions.NotAuthorizedException - if the current user is not ADMIN or BUSINESS_ADMIN.