public final class FieldAccessRoleEvaluator extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
FieldAccessRoleEvaluator.Operation |
| Constructor and Description |
|---|
FieldAccessRoleEvaluator(EntityMetadata md,
Set<String> callerRoles) |
| Modifier and Type | Method and Description |
|---|---|
Projection |
getExcludedFields(FieldAccessRoleEvaluator.Operation op)
Returns a projection that excludes the fields the caller does not have
access to based on the operation
|
List<Path> |
getInaccessibleFields_Insert(JsonDoc doc)
Returns a list of fields in the doc inaccessible to the current user
during insertion.
|
List<Path> |
getInaccessibleFields_Update(JsonDoc newDoc,
JsonDoc oldDoc)
Returns a list of fields in the doc inaccessible to the current user
during update.
|
Set<Path> |
getInaccessibleFields(FieldAccessRoleEvaluator.Operation op)
Returns a set of fields that are inaccessible to the user for the given
operation
|
boolean |
hasAccess(Path field,
FieldAccessRoleEvaluator.Operation op)
Returns whether the current caller has access to the given field based on
the operation
|
boolean |
hasAccess(Set<Path> fields,
FieldAccessRoleEvaluator.Operation op)
Returns whether the current caller has access to all the given fields
based on the operation
|
public FieldAccessRoleEvaluator(EntityMetadata md, Set<String> callerRoles)
public boolean hasAccess(Set<Path> fields, FieldAccessRoleEvaluator.Operation op)
public boolean hasAccess(Path field, FieldAccessRoleEvaluator.Operation op)
public Set<Path> getInaccessibleFields(FieldAccessRoleEvaluator.Operation op)
public List<Path> getInaccessibleFields_Insert(JsonDoc doc)
public List<Path> getInaccessibleFields_Update(JsonDoc newDoc, JsonDoc oldDoc)
newDoc - The new version of the documentoldDoc - The old version of the documentpublic Projection getExcludedFields(FieldAccessRoleEvaluator.Operation op)
Copyright © 2015. All rights reserved.