Class PermissionServiceImpl
java.lang.Object
com.foreach.across.modules.user.services.PermissionServiceImpl
- All Implemented Interfaces:
PermissionService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondefinePermission(Permission permissionDto) Ensures the given permission exists based on the unique name.definePermission(String name, String description, PermissionGroup group) Ensures a permission with the given name and description exists.definePermission(String name, String description, String groupName) Ensures a permission with the given name and description exists.voiddeleteGroup(PermissionGroup group) Delete the PermissionGroup entity.voiddeletePermission(Permission permission) Delete the Permission entity.getPermission(String name) Get the Permission entity by name.getPermissionGroup(String name) Get the PermissionGroup entity by name.Get all defined permission groups.Get all defined permissions.saveGroup(PermissionGroup dto) Save the PermissionGroup entity.savePermission(Permission permission) Save the Permission entity.
-
Constructor Details
-
PermissionServiceImpl
public PermissionServiceImpl()
-
-
Method Details
-
definePermission
@Transactional("jpaTransactionManager") public Permission definePermission(String name, String description, String groupName) Description copied from interface:PermissionServiceEnsures a permission with the given name and description exists. The name is the unique identifier of the permission.- Specified by:
definePermissionin interfacePermissionService- Parameters:
name- Unique name of the permission.description- Description of the permission.groupName- Name of the permission group the permission should be linked to.- Returns:
- Permission instance that was created or update
-
definePermission
@Transactional("jpaTransactionManager") public Permission definePermission(String name, String description, PermissionGroup group) Description copied from interface:PermissionServiceEnsures a permission with the given name and description exists. The name is the unique identifier of the permission.- Specified by:
definePermissionin interfacePermissionService- Parameters:
name- Unique name of the permission.description- Description of the permission.group- Group for the permission.- Returns:
- Permission instance that was created or updated.
-
definePermission
@Transactional("jpaTransactionManager") public Permission definePermission(Permission permissionDto) Description copied from interface:PermissionServiceEnsures the given permission exists based on the unique name.- Specified by:
definePermissionin interfacePermissionService- Parameters:
permissionDto- Permission entity that should exist.
-
getPermissionGroups
Description copied from interface:PermissionServiceGet all defined permission groups.- Specified by:
getPermissionGroupsin interfacePermissionService- Returns:
- Collection of PermissionGroup entities.
-
getPermissionGroup
Description copied from interface:PermissionServiceGet the PermissionGroup entity by name.- Specified by:
getPermissionGroupin interfacePermissionService- Parameters:
name- Unique name of the permission group.- Returns:
- PermissionGroup entity of null.
-
saveGroup
Description copied from interface:PermissionServiceSave the PermissionGroup entity.- Specified by:
saveGroupin interfacePermissionService- Parameters:
dto- Entity to save.- Returns:
- Persisted entity.
-
deleteGroup
Description copied from interface:PermissionServiceDelete the PermissionGroup entity.- Specified by:
deleteGroupin interfacePermissionService- Parameters:
group- Entity to delete.
-
getPermissions
Description copied from interface:PermissionServiceGet all defined permissions.- Specified by:
getPermissionsin interfacePermissionService- Returns:
- Collection of Permission entities.
-
getPermission
Description copied from interface:PermissionServiceGet the Permission entity by name.- Specified by:
getPermissionin interfacePermissionService- Parameters:
name- Unique name of the permission.- Returns:
- Permission entity of null.
-
savePermission
Description copied from interface:PermissionServiceSave the Permission entity.- Specified by:
savePermissionin interfacePermissionService- Parameters:
permission- Entity to save.
-
deletePermission
Description copied from interface:PermissionServiceDelete the Permission entity.- Specified by:
deletePermissionin interfacePermissionService- Parameters:
permission- Entity to delete.
-