@Setup(mode=SINGLETON, priority=2000) public class ACLJsonEnricher extends AbstractJsonEnricher<DocumentModel>
DocumentModel
Json.
Add DocumentModel
's ACP as json attachment.
Enable if parameter enrichers-document=acls is present.
Format is:
{ "entity-type":"document", ... "contextParameters": { "acls": [ { "name": "inherited", "aces" :[ { "username": "administrators", "permission": "Everything", "granted": true, "creator": "Administrator", "begin": "2014-10-19T09:16:30.291Z", "end": "2016-10-19T09:16:30.291Z" "notify": true // optional "comment": "" // optional }, ... ] }, ... ] } }
{@code username} and {@code creator} property can be fetched with fetch.acls=username or fetch.acls=creator.
Additional ACE fields (such as notify and notification comment) can be written by using fetch.acls=extended.
NuxeoPrincipalJsonWriter
,
NuxeoGroupJsonWriter
Modifier and Type | Field and Description |
---|---|
static String |
CREATOR_PROPERTY |
static String |
EXTENDED_ACLS_PROPERTY |
static String |
NAME |
static String |
USERNAME_PROPERTY |
ENTITY_ENRICHER_NAME
ctx, registry
Constructor and Description |
---|
ACLJsonEnricher() |
Modifier and Type | Method and Description |
---|---|
protected Map<String,Serializable> |
computeAdditionalFields(DocumentModel doc,
String aclName,
String aceId) |
protected String |
computeDirectoryId(DocumentModel doc,
String aclName,
String aceId) |
void |
write(org.codehaus.jackson.JsonGenerator jg,
DocumentModel document)
When implementing this method, the provided
JsonGenerator expect you write a field name and a field value
(or many). |
protected void |
writePrincipalOrGroup(String propertyName,
String value,
org.codehaus.jackson.JsonGenerator jg) |
accept, write
getGenerator, write, writeEntity, writeEntity, writeEntityField
public static final String NAME
public static final String USERNAME_PROPERTY
public static final String CREATOR_PROPERTY
public static final String EXTENDED_ACLS_PROPERTY
public ACLJsonEnricher()
public void write(org.codehaus.jackson.JsonGenerator jg, DocumentModel document) throws IOException
AbstractJsonEnricher
JsonGenerator
expect you write a field name and a field value
(or many).write
in class AbstractJsonEnricher<DocumentModel>
jg
- The JsonGenerator
to use.document
- The enriched entity.IOException
protected void writePrincipalOrGroup(String propertyName, String value, org.codehaus.jackson.JsonGenerator jg) throws IOException
IOException
protected Map<String,Serializable> computeAdditionalFields(DocumentModel doc, String aclName, String aceId)
protected String computeDirectoryId(DocumentModel doc, String aclName, String aceId)
Copyright © 2016 Nuxeo SA. All rights reserved.