Package org.nuxeo.ecm.permissions
Class ACLJsonEnricher
java.lang.Object
org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter<Enriched<EntityType>>
org.nuxeo.ecm.core.io.marshallers.json.enrichers.AbstractJsonEnricher<DocumentModel>
org.nuxeo.ecm.permissions.ACLJsonEnricher
- All Implemented Interfaces:
Marshaller<Enriched<DocumentModel>>,Writer<Enriched<DocumentModel>>
@Setup(mode=SINGLETON,
priority=2000)
public class ACLJsonEnricher
extends AbstractJsonEnricher<DocumentModel>
Enrich
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
},
...
]
},
...
]
}
}
username and 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.
- Since:
- 7.2
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.nuxeo.ecm.core.io.marshallers.json.enrichers.AbstractJsonEnricher
ENTITY_ENRICHER_NAME, MAPPERFields inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
ctx, registry -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Map<String,Serializable> computeAdditionalFields(DocumentModel doc, String aclName, String aceId) protected StringcomputeDirectoryId(DocumentModel doc, String aclName, String aceId) voidwrite(com.fasterxml.jackson.core.JsonGenerator jg, DocumentModel document) When implementing this method, the providedJsonGeneratorexpect you write a field name and a field value (or many).protected voidwriteACEsField(com.fasterxml.jackson.core.JsonGenerator jg, String fieldName, ACL acl, DocumentModel document) protected voidwritePrincipalOrGroup(String propertyName, String value, com.fasterxml.jackson.core.JsonGenerator jg) Methods inherited from class org.nuxeo.ecm.core.io.marshallers.json.enrichers.AbstractJsonEnricher
accept, safeReadBuffer, writeMethods inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
getGenerator, write, writeEntity, writeEntity, writeEntityField, writeSerializable, writeSerializableField, writeSerializableListField, writeSerializableMapField
-
Field Details
-
NAME
- See Also:
-
USERNAME_PROPERTY
- See Also:
-
CREATOR_PROPERTY
- See Also:
-
EXTENDED_ACLS_PROPERTY
- See Also:
-
COMPATIBILITY_CONFIGURATION_PARAM
- See Also:
-
-
Constructor Details
-
ACLJsonEnricher
public ACLJsonEnricher()
-
-
Method Details
-
write
public void write(com.fasterxml.jackson.core.JsonGenerator jg, DocumentModel document) throws IOException Description copied from class:AbstractJsonEnricherWhen implementing this method, the providedJsonGeneratorexpect you write a field name and a field value (or many).- Specified by:
writein classAbstractJsonEnricher<DocumentModel>- Parameters:
jg- TheJsonGeneratorto use.document- The enriched entity.- Throws:
IOException
-
writeACEsField
protected void writeACEsField(com.fasterxml.jackson.core.JsonGenerator jg, String fieldName, ACL acl, DocumentModel document) throws IOException - Throws:
IOException
-
writePrincipalOrGroup
protected void writePrincipalOrGroup(String propertyName, String value, com.fasterxml.jackson.core.JsonGenerator jg) throws IOException - Throws:
IOException
-
computeAdditionalFields
protected Map<String,Serializable> computeAdditionalFields(DocumentModel doc, String aclName, String aceId) -
computeDirectoryId
-