Class PermissionServiceImpl
java.lang.Object
com.foreach.across.modules.user.services.PermissionServiceImpl
- All Implemented Interfaces:
PermissionService
-
Constructor Summary
-
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.void
deleteGroup
(PermissionGroup group) Delete the PermissionGroup entity.void
deletePermission
(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:PermissionService
Ensures a permission with the given name and description exists. The name is the unique identifier of the permission.- Specified by:
definePermission
in 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:PermissionService
Ensures a permission with the given name and description exists. The name is the unique identifier of the permission.- Specified by:
definePermission
in 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:PermissionService
Ensures the given permission exists based on the unique name.- Specified by:
definePermission
in interfacePermissionService
- Parameters:
permissionDto
- Permission entity that should exist.
-
getPermissionGroups
Description copied from interface:PermissionService
Get all defined permission groups.- Specified by:
getPermissionGroups
in interfacePermissionService
- Returns:
- Collection of PermissionGroup entities.
-
getPermissionGroup
Description copied from interface:PermissionService
Get the PermissionGroup entity by name.- Specified by:
getPermissionGroup
in interfacePermissionService
- Parameters:
name
- Unique name of the permission group.- Returns:
- PermissionGroup entity of null.
-
saveGroup
Description copied from interface:PermissionService
Save the PermissionGroup entity.- Specified by:
saveGroup
in interfacePermissionService
- Parameters:
dto
- Entity to save.- Returns:
- Persisted entity.
-
deleteGroup
Description copied from interface:PermissionService
Delete the PermissionGroup entity.- Specified by:
deleteGroup
in interfacePermissionService
- Parameters:
group
- Entity to delete.
-
getPermissions
Description copied from interface:PermissionService
Get all defined permissions.- Specified by:
getPermissions
in interfacePermissionService
- Returns:
- Collection of Permission entities.
-
getPermission
Description copied from interface:PermissionService
Get the Permission entity by name.- Specified by:
getPermission
in interfacePermissionService
- Parameters:
name
- Unique name of the permission.- Returns:
- Permission entity of null.
-
savePermission
Description copied from interface:PermissionService
Save the Permission entity.- Specified by:
savePermission
in interfacePermissionService
- Parameters:
permission
- Entity to save.
-
deletePermission
Description copied from interface:PermissionService
Delete the Permission entity.- Specified by:
deletePermission
in interfacePermissionService
- Parameters:
permission
- Entity to delete.
-