Class RoleServiceImpl
java.lang.Object
com.foreach.across.modules.user.services.RoleServiceImpl
- All Implemented Interfaces:
RoleService
-
Constructor Summary
Constructors -
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.voidDelete 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:RoleServiceEnsures a Role with the specified permissions exists. The name is the unique key of the role.- Specified by:
defineRolein 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:RoleServiceEnsures a Role with the specified permissions exists. The name is the unique key of the role.- Specified by:
defineRolein 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:RoleServiceEnsures the given Role exists based on the unique name.- Specified by:
defineRolein interfaceRoleService- Parameters:
role- Role entity that should exist.
-
getRoles
Description copied from interface:RoleServiceGet all defined Roles.- Specified by:
getRolesin interfaceRoleService- Returns:
- Collection of Role entities.
-
getRole
Description copied from interface:RoleServiceGet the Role entity with the given authority.- Specified by:
getRolein interfaceRoleService- Parameters:
authority- Unique authority of the Role.- Returns:
- Role entity or null;
-
save
Description copied from interface:RoleServiceSave the given Role entity.- Specified by:
savein interfaceRoleService- Parameters:
role- Entity to save.
-
delete
Description copied from interface:RoleServiceDelete the given Role entity.- Specified by:
deletein interfaceRoleService- Parameters:
role- Entity to delete.
-