Interface PermissionService
- All Known Implementing Classes:
PermissionServiceImpl
public interface PermissionService
-
Method Summary
Modifier and TypeMethodDescriptiondefinePermission
(Permission permission) 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.
-
Method Details
-
definePermission
Ensures a permission with the given name and description exists. The name is the unique identifier of the permission.- 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
Ensures a permission with the given name and description exists. The name is the unique identifier of the permission.- 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
Ensures the given permission exists based on the unique name.- Parameters:
permission
- Permission entity that should exist.
-
getPermissionGroups
Collection<PermissionGroup> getPermissionGroups()Get all defined permission groups.- Returns:
- Collection of PermissionGroup entities.
-
getPermissionGroup
Get the PermissionGroup entity by name.- Parameters:
name
- Unique name of the permission group.- Returns:
- PermissionGroup entity of null.
-
saveGroup
Save the PermissionGroup entity.- Parameters:
dto
- Entity to save.- Returns:
- Persisted entity.
-
deleteGroup
Delete the PermissionGroup entity.- Parameters:
group
- Entity to delete.
-
getPermissions
Collection<Permission> getPermissions()Get all defined permissions.- Returns:
- Collection of Permission entities.
-
getPermission
Get the Permission entity by name.- Parameters:
name
- Unique name of the permission.- Returns:
- Permission entity of null.
-
savePermission
Save the Permission entity.- Parameters:
permission
- Entity to save.
-
deletePermission
Delete the Permission entity.- Parameters:
permission
- Entity to delete.
-