Package ch.ivyteam.ivy.security.role
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
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 Java.
-
create
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 Java.
- Security:
- SESSION OWNS RoleCreate PERMISSION OR OWNS RoleCreate@SYSTEM PERMISSION
-
delete
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 Java.
- Security:
- SESSION OWNS RoleDelete PERMISSION OR OWNS RoleDelete@SYSTEM PERMISSION
-
find
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 Java.
- Security:
- SESSION OWNS RoleReadAll PERMISSION OR OWNS RoleReadAll@SYSTEM PERMISSION
-
findById
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 Java.
- 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 Java.
- Security:
- SESSION OWNS RoleReadAll PERMISSION OR OWNS RoleReadAll@SYSTEM PERMISSION
-
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 Java.
- Security:
- SESSION OWNS RoleReadAll PERMISSION OR OWNS RoleReadAll@SYSTEM PERMISSION
-
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 toall()
,roles
will be excluded, which only exists in outdated Process Model Versions. - API:
- This public API is available in Java.
-
count
int count()Count all roles- Returns:
- role count
- API:
- This public API is available in Java.
-