Record Class CollectionAcl

java.lang.Object
java.lang.Record
org.exoplatform.caldav.client.CollectionAcl
Record Components:
readable - whether the server granted DAV:acl
understood - whether every entry was parsed, false as well when the ACL is not readable
entries - the entries in document order, empty unless understood
currentUserPrivileges - the caller's own privileges on the collection as Clark names, empty when the server answered none
reason - what could not be parsed, for the log; null when understood

public record CollectionAcl(boolean readable, boolean understood, List<AccessControlEntry> entries, Set<String> currentUserPrivileges, String reason) extends Record
A collection's DAV:acl as the server answered it to its owner (EXO-90253), with the two facts that decide whether it may be written back.

Readable: the server granted the property. Reading it needs DAV:read-acl (RFC 3744 §3.6), and a server may answer it in a 403 or 404 propstat; currentUserPrivileges() then says whether the privilege was missing.

Understood: every entry parsed into an AccessControlEntry. Writing an ACL replaces every modifiable entry, so a list read with one entry skipped would delete that entry — somebody's share, possibly made outside eXo — the moment it is written back. An ACL that is not understood is never written.

  • Constructor Details

    • CollectionAcl

      public CollectionAcl(boolean readable, boolean understood, List<AccessControlEntry> entries, Set<String> currentUserPrivileges, String reason)
      Creates an instance of a CollectionAcl record class.
      Parameters:
      readable - the value for the readable record component
      understood - the value for the understood record component
      entries - the value for the entries record component
      currentUserPrivileges - the value for the currentUserPrivileges record component
      reason - the value for the reason record component
  • Method Details

    • of

      public static CollectionAcl of(List<AccessControlEntry> entries, Set<String> currentUserPrivileges)
      An ACL read and parsed entirely.
      Parameters:
      entries - the entries
      currentUserPrivileges - the caller's privileges
      Returns:
      the ACL
    • unreadable

      public static CollectionAcl unreadable(Set<String> currentUserPrivileges)
      An ACL the server did not grant.
      Parameters:
      currentUserPrivileges - the caller's privileges, possibly empty
      Returns:
      the ACL
    • notUnderstood

      public static CollectionAcl notUnderstood(Set<String> currentUserPrivileges, String reason)
      An ACL granted but holding something this client cannot represent.
      Parameters:
      currentUserPrivileges - the caller's privileges
      reason - what was not understood
      Returns:
      the ACL
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • readable

      public boolean readable()
      Returns the value of the readable record component.
      Returns:
      the value of the readable record component
    • understood

      public boolean understood()
      Returns the value of the understood record component.
      Returns:
      the value of the understood record component
    • entries

      public List<AccessControlEntry> entries()
      Returns the value of the entries record component.
      Returns:
      the value of the entries record component
    • currentUserPrivileges

      public Set<String> currentUserPrivileges()
      Returns the value of the currentUserPrivileges record component.
      Returns:
      the value of the currentUserPrivileges record component
    • reason

      public String reason()
      Returns the value of the reason record component.
      Returns:
      the value of the reason record component