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 Details

    • PermissionDTO

      public PermissionDTO(String groupPath, String userId)
      Constructor that creates the DTO from a given group path.
      Parameters:
      groupPath - the flat path including the domain name and the permitted role
      userId - the user ID associated with the permission
  • Method Details

    • assignPojoValues

      public PermissionDTO assignPojoValues(String pojo)
      Unused.
      Specified by:
      assignPojoValues in interface IObjectDTO<String,PermissionDTO>
    • isValidStandardView

      public Boolean isValidStandardView()
      Checks whether the default view of the object is valid.
      Specified by:
      isValidStandardView in interface IObjectDTO<String,PermissionDTO>
      Returns:
      true if the default view is valid, otherwise false
    • toReducedStandardView

      public PermissionDTO toReducedStandardView()
      Reduces the object to its standard view.
      Specified by:
      toReducedStandardView in interface IObjectDTO<String,PermissionDTO>
      Returns:
      the reduced PermissionDTO object
    • toRepresentationString

      public String toRepresentationString()
      Returns a string representation of the object. The representation includes the values for role, domain, and user ID.
      Specified by:
      toRepresentationString in interface IObjectDTO<String,PermissionDTO>
      Returns:
      a string representation of the object
    • validate

      public Boolean validate()
      Validates the permission. Checks whether the role is valid and whether the domain or project exists.
      Specified by:
      validate in interface IObjectDTO<String,PermissionDTO>
      Returns:
      true if the permission is valid, otherwise false
    • getRolePath

      public String getRolePath()
      Returns the partial path for the role.
      Returns:
      the path up until the role
    • getDomainPath

      public String getDomainPath()
      Returns the path for the domain. Includes the role.
      Returns:
      the path including the role and the domain name
    • getProjectPath

      public String getProjectPath()
      Returns the path for the project. Includes the role.
      Returns:
      the path including the role and the project name
    • isPermissionInList

      public boolean isPermissionInList(List<PermissionDTO> permissions)
      Checks if a given permission is already present in the list of permissions.
      Parameters:
      permissions - the list of permissions to check against
      Returns:
      true if the permission is found in the list, false otherwise