Class AclFlattener

java.lang.Object
com.norconex.committer.core.acl.AclFlattener

public final class AclFlattener extends Object

Writes an Acl as plain multi-valued fields, for destinations that cannot take JSON (AclFormat.FLAT). With the default prefix:

 acl.levels      = share, file
 acl.share.allow = group:ad:CORP:Sales
 acl.file.allow  = group:ad:CORP:Sales
 acl.file.allow  = special:everyone
 acl.file.deny   = group:ad:CORP:Interns
 acl.owners      = user:ad:CORP:pascal
 

Each value is a principal as kind:dir:id (or special:id), see AclEntry.principalText(). acl.levels names the levels in order. Whoever searches the destination may show a document to a person who matches an allow value of every level and no deny value of any: a level without allow values admits nobody. Two levels of the same name get a number added to the second (file, file2).

  • Method Details

    • flatten

      public static Properties flatten(Acl acl, String prefix)
      Parameters:
      acl - the ACL
      prefix - the prefix of the fields written, without the dot
      Returns:
      the fields