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
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
Fields inherited from class org.nuxeo.ecm.core.io.marshallers.json.enrichers.AbstractJsonEnricher
ENTITY_ENRICHER_NAME, MAPPER
Fields inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
ctx, registry
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Map<String,
Serializable> computeAdditionalFields
(DocumentModel doc, String aclName, String aceId) protected String
computeDirectoryId
(DocumentModel doc, String aclName, String aceId) void
write
(com.fasterxml.jackson.core.JsonGenerator jg, DocumentModel document) When implementing this method, the providedJsonGenerator
expect you write a field name and a field value (or many).protected void
writeACEsField
(com.fasterxml.jackson.core.JsonGenerator jg, String fieldName, ACL acl, DocumentModel document) protected void
writePrincipalOrGroup
(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, write
Methods 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:AbstractJsonEnricher
When implementing this method, the providedJsonGenerator
expect you write a field name and a field value (or many).- Specified by:
write
in classAbstractJsonEnricher<DocumentModel>
- Parameters:
jg
- TheJsonGenerator
to 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
-