@Service public class RoleServiceImpl extends Object implements RoleService
| Constructor and Description |
|---|
RoleServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
Role |
defineRole(Role role)
Ensures the given Role exists based on the unique name.
|
Role |
defineRole(String authority,
String name,
Collection<String> permissionNames)
Ensures a Role with the specified permissions exists.
|
Role |
defineRole(String authority,
String name,
String description,
Collection<String> permissionNames)
Ensures a Role with the specified permissions exists.
|
void |
delete(Role role)
Delete the given Role entity.
|
Role |
getRole(String authority)
Get the Role entity with the given authority.
|
Collection<Role> |
getRoles()
Get all defined Roles.
|
Role |
save(Role role)
Save the given Role entity.
|
public Role defineRole(String authority, String name, Collection<String> permissionNames)
RoleServicedefineRole in interface RoleServiceauthority - Unique authority of the Role entity.name - Descriptive name of the Role.permissionNames - Permission names to apply to the role.public Role defineRole(String authority, String name, String description, Collection<String> permissionNames)
RoleServicedefineRole in interface RoleServiceauthority - 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.public Role defineRole(Role role)
RoleServicedefineRole in interface RoleServicerole - Role entity that should exist.public Collection<Role> getRoles()
RoleServicegetRoles in interface RoleServicepublic Role getRole(String authority)
RoleServicegetRole in interface RoleServiceauthority - Unique authority of the Role.@Transactional(value="jpaTransactionManager") public Role save(Role role)
RoleServicesave in interface RoleServicerole - Entity to save.public void delete(Role role)
RoleServicedelete in interface RoleServicerole - Entity to delete.Copyright © 2020. All rights reserved.