@Setup(mode=SINGLETON, priority=2000) public class BasePermissionsJsonEnricher extends AbstractJsonEnricher<DocumentModel>
DocumentModel
Json.
Add permission available for current user on given DocumentModel
's as json attachment. Limit permission to
Read, Write and Everything.
Enable if parameter enrichers-document=permissions is present.
Format is:
{ "entity-type":"document", ... "contextParameters": { "permissions": [ "Read", "Write", "Everything" ] <- depending on current user permission on document } }
Modifier and Type | Field and Description |
---|---|
static String |
NAME |
ENTITY_ENRICHER_NAME
ctx, registry
Constructor and Description |
---|
BasePermissionsJsonEnricher() |
Modifier and Type | Method and Description |
---|---|
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). |
accept, write
getGenerator, write, writeEntity, writeEntity, writeEntityField
public static final String NAME
public BasePermissionsJsonEnricher()
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
Copyright © 2018 Nuxeo. All rights reserved.