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>
EnrichDocumentModel
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
andcreator
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:
NuxeoPrincipalJsonWriter
,NuxeoGroupJsonWriter
-
-
Field Summary
Fields Modifier and Type Field Description static String
COMPATIBILITY_CONFIGURATION_PARAM
static String
CREATOR_PROPERTY
static String
EXTENDED_ACLS_PROPERTY
static String
NAME
static String
USERNAME_PROPERTY
-
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
Constructors Constructor Description ACLJsonEnricher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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 Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
USERNAME_PROPERTY
public static final String USERNAME_PROPERTY
- See Also:
- Constant Field Values
-
CREATOR_PROPERTY
public static final String CREATOR_PROPERTY
- See Also:
- Constant Field Values
-
EXTENDED_ACLS_PROPERTY
public static final String EXTENDED_ACLS_PROPERTY
- See Also:
- Constant Field Values
-
COMPATIBILITY_CONFIGURATION_PARAM
public static final String COMPATIBILITY_CONFIGURATION_PARAM
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
protected String computeDirectoryId(DocumentModel doc, String aclName, String aceId)
-
-