Interface IRoleRepository


public interface IRoleRepository

Role repository to find and create and delete roles.

Since:
9.3
API:
This is a public API.
  • Method Details

    • create

      IRole create(String name)

      Creates a new role.

      Example:

      ivy.security.roles().create("Manager");
      Parameters:
      name - the name of the role
      Returns:
      new role
      Since:
      9.4
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • create

      IRole create(NewRole role)

      Creates a new role.

      Example:

      
       import ch.ivyteam.ivy.security.role.NewRole;
      
       NewRole newRole = NewRole
           .create("Manager")
           .displayName("HR Manager")
           .description("The chief of the HR organization")
           .toNewRole();
       ivy.security.roles().create(newRole);
      Parameters:
      role - information about the new role
      Returns:
      the new role
      Since:
      9.4
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
      Security:
      SESSION OWNS RoleCreate PERMISSION OR OWNS RoleCreate@SYSTEM PERMISSION
    • delete

      void delete(String roleName)
      Delete the role with the given roleName. If the role does not exists this method does nothing.
      Parameters:
      roleName - name of the role
      See Also:
      • IRole.delete()
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
      Security:
      SESSION OWNS RoleDelete PERMISSION OR OWNS RoleDelete@SYSTEM PERMISSION
    • find

      IRole find(String roleName)
      Finds a role by its name
      Parameters:
      roleName - The name of a role
      Returns:
      role or null if no role was found
      API:
      This public API is available in IvyScript and Java. It has the visibility NOVICE.
      Security:
      SESSION OWNS RoleReadAll PERMISSION OR OWNS RoleReadAll@SYSTEM PERMISSION
    • findById

      IRole findById(String securityMemberId)
      Finds a role by its id
      Parameters:
      securityMemberId - The security member id of a role
      Returns:
      role or null if no role was found
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
      Security:
      SESSION OWNS RoleReadAll PERMISSION OR OWNS RoleReadAll@SYSTEM PERMISSION
    • topLevel

      IRole topLevel()
      Returns:
      top level role (Everybody)
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
      Security:
      SESSION OWNS RoleReadAll PERMISSION OR OWNS RoleReadAll@SYSTEM PERMISSION
    • all

      List<IRole> all()
      Returns:
      All roles. Flat without any hierarchy, but the child roles of a role are always behind the parent role.
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
      Security:
      SESSION OWNS RoleReadAll PERMISSION OR OWNS RoleReadAll@SYSTEM PERMISSION
    • active

      List<IRole> active()
      Returns:
      all roles which could be actively used by the system. Flat without any hierarchy, but the child roles of a role are always behind the parent role.
      In comparison to all(), roles will be excluded, which only exists in outdated Process Model Versions.
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
    • count

      int count()
      Count all roles
      Returns:
      role count
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.