Class RoleServiceImpl
java.lang.Object
com.foreach.across.modules.user.services.RoleServiceImpl
- All Implemented Interfaces:
RoleService
-
Constructor Summary
-
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> permissionNames) Ensures a Role with the specified permissions exists.defineRole
(String authority, String name, Collection<String> permissionNames) Ensures a Role with the specified permissions exists.void
Delete the given Role entity.Get the Role entity with the given authority.getRoles()
Get all defined Roles.Save the given Role entity.
-
Constructor Details
-
RoleServiceImpl
public RoleServiceImpl()
-
-
Method Details
-
defineRole
Description copied from interface:RoleService
Ensures a Role with the specified permissions exists. The name is the unique key of the role.- Specified by:
defineRole
in interfaceRoleService
- Parameters:
authority
- Unique authority of the Role entity.name
- Descriptive name of the Role.permissionNames
- Permission names to apply to the role.- Returns:
- Role instance that was created or updated.
-
defineRole
public Role defineRole(String authority, String name, String description, Collection<String> permissionNames) Description copied from interface:RoleService
Ensures a Role with the specified permissions exists. The name is the unique key of the role.- Specified by:
defineRole
in interfaceRoleService
- Parameters:
authority
- Unique authority of the Role entity.name
- Descriptive name of the Role.description
- Description of what the role should be used for.permissionNames
- Permission names to apply to the role.- Returns:
- Role instance that was created or updated.
-
defineRole
Description copied from interface:RoleService
Ensures the given Role exists based on the unique name.- Specified by:
defineRole
in interfaceRoleService
- Parameters:
role
- Role entity that should exist.
-
getRoles
Description copied from interface:RoleService
Get all defined Roles.- Specified by:
getRoles
in interfaceRoleService
- Returns:
- Collection of Role entities.
-
getRole
Description copied from interface:RoleService
Get the Role entity with the given authority.- Specified by:
getRole
in interfaceRoleService
- Parameters:
authority
- Unique authority of the Role.- Returns:
- Role entity or null;
-
save
Description copied from interface:RoleService
Save the given Role entity.- Specified by:
save
in interfaceRoleService
- Parameters:
role
- Entity to save.
-
delete
Description copied from interface:RoleService
Delete the given Role entity.- Specified by:
delete
in interfaceRoleService
- Parameters:
role
- Entity to delete.
-