Class DirectoryPermissions


  • @AggregateRoot
    public class DirectoryPermissions
    extends java.lang.Object
    Represents a collection of Permissions for a Directory.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static DirectoryPermissionsBuilder builder()
      Returns DirectoryPermissionsBuilder.
      protected boolean canEqual​(java.lang.Object other)  
      boolean equals​(java.lang.Object o)  
      java.time.Instant getCreationTime()
      Get the creation time.
      java.lang.Long getId()
      Id in database.
      java.time.Instant getLastModifiedTime()
      Get the last modified time.
      @NonNull java.util.Set<mops.persistence.permission.DirectoryPermissionEntry> getPermissions()
      The permission entries.
      java.util.Set<java.lang.String> getRoles()
      Get all roles for which there are permissions.
      int hashCode()  
      boolean isAllowedToDelete​(java.lang.String userRole)
      Checks if a role has deleting access.
      boolean isAllowedToRead​(java.lang.String userRole)
      Checks if a role has reading access.
      boolean isAllowedToWrite​(java.lang.String userRole)
      Checks if a role has writing access.
      void setPermissions​(@NonNull java.util.Set<mops.persistence.permission.DirectoryPermissionEntry> permissions)
      The permission entries.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getCreationTime

        public java.time.Instant getCreationTime()
        Get the creation time.
        Returns:
        creation time
      • getLastModifiedTime

        public java.time.Instant getLastModifiedTime()
        Get the last modified time.
        Returns:
        last modified time
      • isAllowedToWrite

        public boolean isAllowedToWrite​(java.lang.String userRole)
        Checks if a role has writing access.
        Parameters:
        userRole - role of the user in group
        Returns:
        boolean if user is allowed to write
      • isAllowedToRead

        public boolean isAllowedToRead​(java.lang.String userRole)
        Checks if a role has reading access.
        Parameters:
        userRole - role of the user in group
        Returns:
        boolean if user is allowed
      • isAllowedToDelete

        public boolean isAllowedToDelete​(java.lang.String userRole)
        Checks if a role has deleting access.
        Parameters:
        userRole - role of the user in group
        Returns:
        boolean if user is allowed to delete
      • getRoles

        public java.util.Set<java.lang.String> getRoles()
        Get all roles for which there are permissions.
        Returns:
        roles
      • builder

        public static DirectoryPermissionsBuilder builder()
        Returns DirectoryPermissionsBuilder.
        Returns:
        DirectoryPermissionsBuilder
      • getId

        public java.lang.Long getId()
        Id in database.
      • getPermissions

        @NonNull
        public @NonNull java.util.Set<mops.persistence.permission.DirectoryPermissionEntry> getPermissions()
        The permission entries.
      • setPermissions

        public void setPermissions​(@NonNull
                                   @NonNull java.util.Set<mops.persistence.permission.DirectoryPermissionEntry> permissions)
        The permission entries.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object