Class RoleServiceImpl

java.lang.Object
com.foreach.across.modules.user.services.RoleServiceImpl
All Implemented Interfaces:
RoleService

@Service public class RoleServiceImpl extends Object implements RoleService
  • Constructor Details

    • RoleServiceImpl

      public RoleServiceImpl()
  • Method Details

    • defineRole

      public Role defineRole(String authority, String name, 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 interface RoleService
      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 interface RoleService
      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

      public Role defineRole(Role role)
      Description copied from interface: RoleService
      Ensures the given Role exists based on the unique name.
      Specified by:
      defineRole in interface RoleService
      Parameters:
      role - Role entity that should exist.
    • getRoles

      public Collection<Role> getRoles()
      Description copied from interface: RoleService
      Get all defined Roles.
      Specified by:
      getRoles in interface RoleService
      Returns:
      Collection of Role entities.
    • getRole

      public Role getRole(String authority)
      Description copied from interface: RoleService
      Get the Role entity with the given authority.
      Specified by:
      getRole in interface RoleService
      Parameters:
      authority - Unique authority of the Role.
      Returns:
      Role entity or null;
    • save

      @Transactional("jpaTransactionManager") public Role save(Role role)
      Description copied from interface: RoleService
      Save the given Role entity.
      Specified by:
      save in interface RoleService
      Parameters:
      role - Entity to save.
    • delete

      public void delete(Role role)
      Description copied from interface: RoleService
      Delete the given Role entity.
      Specified by:
      delete in interface RoleService
      Parameters:
      role - Entity to delete.