Package org.trustdeck.dto
Class PermissionDTO
java.lang.Object
org.trustdeck.dto.PermissionDTO
- All Implemented Interfaces:
IObjectDTO<String,PermissionDTO>
@Scope("prototype")
public class PermissionDTO
extends Object
implements IObjectDTO<String,PermissionDTO>
Data Transfer Object (DTO) for permissions. This class represents the
permissions of a user for a specific domain/project and role.
- Author:
- Eric Wündisch, Armin Müller
-
Constructor Summary
ConstructorsConstructorDescriptionPermissionDTO(String groupPath, String userId) Constructor that creates the DTO from a given group path. -
Method Summary
Modifier and TypeMethodDescriptionassignPojoValues(String pojo) Unused.Returns the path for the domain.Returns the path for the project.Returns the partial path for the role.booleanisPermissionInList(List<PermissionDTO> permissions) Checks if a given permission is already present in the list of permissions.Checks whether the default view of the object is valid.Reduces the object to its standard view.Returns a string representation of the object.validate()Validates the permission.
-
Constructor Details
-
PermissionDTO
Constructor that creates the DTO from a given group path.- Parameters:
groupPath- the flat path including the domain name and the permitted roleuserId- the user ID associated with the permission
-
-
Method Details
-
assignPojoValues
Unused.- Specified by:
assignPojoValuesin interfaceIObjectDTO<String,PermissionDTO>
-
isValidStandardView
Checks whether the default view of the object is valid.- Specified by:
isValidStandardViewin interfaceIObjectDTO<String,PermissionDTO> - Returns:
trueif the default view is valid, otherwisefalse
-
toReducedStandardView
Reduces the object to its standard view.- Specified by:
toReducedStandardViewin interfaceIObjectDTO<String,PermissionDTO> - Returns:
- the reduced PermissionDTO object
-
toRepresentationString
Returns a string representation of the object. The representation includes the values for role, domain, and user ID.- Specified by:
toRepresentationStringin interfaceIObjectDTO<String,PermissionDTO> - Returns:
- a string representation of the object
-
validate
Validates the permission. Checks whether the role is valid and whether the domain or project exists.- Specified by:
validatein interfaceIObjectDTO<String,PermissionDTO> - Returns:
trueif the permission is valid, otherwisefalse
-
getRolePath
Returns the partial path for the role.- Returns:
- the path up until the role
-
getDomainPath
Returns the path for the domain. Includes the role.- Returns:
- the path including the role and the domain name
-
getProjectPath
Returns the path for the project. Includes the role.- Returns:
- the path including the role and the project name
-
isPermissionInList
Checks if a given permission is already present in the list of permissions.- Parameters:
permissions- the list of permissions to check against- Returns:
trueif the permission is found in the list,falseotherwise
-