Interface RoleService
- All Known Implementing Classes:
RoleServiceImpl
public interface RoleService
-
Method Summary
Modifier and TypeMethodDescriptiondefineRole(Role role) Ensures the given Role exists based on the unique name.defineRole(String authority, String name, String description, Collection<String> permissions) Ensures a Role with the specified permissions exists.defineRole(String authority, String name, Collection<String> permissions) Deprecated.voidDelete the given Role entity.Get the Role entity with the given authority.getRoles()Get all defined Roles.Save the given Role entity.
-
Method Details
-
defineRole
Deprecated.Ensures a Role with the specified permissions exists. The name is the unique key of the role.- Parameters:
authority- Unique authority of the Role entity.name- Descriptive name of the Role.permissions- Permission names to apply to the role.- Returns:
- Role instance that was created or updated.
-
defineRole
Ensures a Role with the specified permissions exists. The name is the unique key of the role.- Parameters:
authority- Unique authority of the Role entity.name- Descriptive name of the Role.description- Description of what the role should be used for.permissions- Permission names to apply to the role.- Returns:
- Role instance that was created or updated.
-
defineRole
Ensures the given Role exists based on the unique name.- Parameters:
role- Role entity that should exist.
-
getRoles
Collection<Role> getRoles()Get all defined Roles.- Returns:
- Collection of Role entities.
-
getRole
Get the Role entity with the given authority.- Parameters:
authority- Unique authority of the Role.- Returns:
- Role entity or null;
-
save
Save the given Role entity.- Parameters:
role- Entity to save.
-
delete
Delete the given Role entity.- Parameters:
role- Entity to delete.
-