public class ExampleEvaluator extends Object implements SecurityEvaluator
SecurityEvaluator.Action, SecurityEvaluator.Util
FUTURE, VARIABLE
Constructor and Description |
---|
ExampleEvaluator(org.apache.jena.rdf.model.Model model) |
Modifier and Type | Method and Description |
---|---|
boolean |
evaluate(Object principal,
SecurityEvaluator.Action action,
org.apache.jena.graph.Node graphIRI)
Determine if the action is allowed on the graph.
|
boolean |
evaluate(Object principal,
SecurityEvaluator.Action action,
org.apache.jena.graph.Node graphIRI,
org.apache.jena.graph.Triple triple)
Determine if the action is allowed on the triple within the graph.
|
boolean |
evaluate(Object principal,
Set<SecurityEvaluator.Action> actions,
org.apache.jena.graph.Node graphIRI)
Determine if all actions are allowed on the graph.
|
boolean |
evaluate(Object principal,
Set<SecurityEvaluator.Action> actions,
org.apache.jena.graph.Node graphIRI,
org.apache.jena.graph.Triple triple)
Determine if all the actions are allowed on the triple within the graph.
|
boolean |
evaluateAny(Object principal,
Set<SecurityEvaluator.Action> actions,
org.apache.jena.graph.Node graphIRI)
Determine if any of the actions are allowed on the graph.
|
boolean |
evaluateAny(Object principal,
Set<SecurityEvaluator.Action> actions,
org.apache.jena.graph.Node graphIRI,
org.apache.jena.graph.Triple triple)
Determine if any of the actions are allowed on the triple within the
graph.
|
boolean |
evaluateUpdate(Object principal,
org.apache.jena.graph.Node graphIRI,
org.apache.jena.graph.Triple from,
org.apache.jena.graph.Triple to)
Determine if the user is allowed to update the "from" triple to the "to"
triple.
|
Principal |
getPrincipal()
returns the current principal or null if there is no current principal.
|
boolean |
isPrincipalAuthenticated(Object principal)
Returns true if the principal is recognized as an authenticated principal
by the underlying authentication mechanism.
|
void |
setPrincipal(String userName) |
public ExampleEvaluator(org.apache.jena.rdf.model.Model model)
model
- The graph we are going to evaluate against.public boolean evaluate(Object principal, SecurityEvaluator.Action action, org.apache.jena.graph.Node graphIRI)
SecurityEvaluator
evaluate
in interface SecurityEvaluator
principal
- The principal that is attempting the action.action
- The action to performgraphIRI
- The IRI of the graph to checkpublic boolean evaluate(Object principal, SecurityEvaluator.Action action, org.apache.jena.graph.Node graphIRI, org.apache.jena.graph.Triple triple)
SecurityEvaluator
The evaluation should be performed in the following order:
VARIABLE
then this method must
return true
if there are any restrictions where the
remaining nodes are either constants or ANY
nodes. This will
force the system to use subsequent checks to verify access by
substituting the value of the VARIABLE
s.
If the system can not quickly verify the solution
it is always acceptable to return true
.
ANY
then this method must return false
if there
are any restrictions where the remaining nodes are held constant and the
ANY node is allowed to vary. This checks is used to avoid subsequent
explicit triple checks.
If the system can not quickly verify the solution it is always
acceptable to return false
.FUTURE
node that node should be considered
as an anonymous or blank node that is not yet created. It should only be
used with Create
actions and is asking if the user may
create a blank node in that position in the triple.evaluate
in interface SecurityEvaluator
principal
- The principal that is attempting the action.action
- The action to performgraphIRI
- The IRI of the graph to the action is being taken upon. May be
ANY
.triple
- The triple to checkpublic boolean evaluate(Object principal, Set<SecurityEvaluator.Action> actions, org.apache.jena.graph.Node graphIRI)
SecurityEvaluator
evaluate
in interface SecurityEvaluator
principal
- The principal that is attempting the action.actions
- The set of actions to performgraphIRI
- The IRI of the graph to the action is being taken upon. May be
ANY
.public boolean evaluate(Object principal, Set<SecurityEvaluator.Action> actions, org.apache.jena.graph.Node graphIRI, org.apache.jena.graph.Triple triple)
SecurityEvaluator
See evaluate( Action, Node, Triple ) for discussion of evaluation strategy.
evaluate
in interface SecurityEvaluator
actions
- The actions to perform.graphIRI
- The IRI of the graph to the action is being taken upon. May be
ANY
.triple
- The triple to checkpublic boolean evaluateAny(Object principal, Set<SecurityEvaluator.Action> actions, org.apache.jena.graph.Node graphIRI)
SecurityEvaluator
evaluateAny
in interface SecurityEvaluator
principal
- The principal that is attempting the action.actions
- The actions to performgraphIRI
- The IRI of the graph to the action is being taken upon. May be
ANY
.public boolean evaluateAny(Object principal, Set<SecurityEvaluator.Action> actions, org.apache.jena.graph.Node graphIRI, org.apache.jena.graph.Triple triple)
SecurityEvaluator
See evaluate( Action, Node, Triple ) for discussion of evaluation strategy.
evaluateAny
in interface SecurityEvaluator
principal
- The principal that is attempting the action.actions
- The actions to check.graphIRI
- The IRI of the graph to the action is being taken upon. May be
ANY
.triple
- The triple to checkpublic boolean evaluateUpdate(Object principal, org.apache.jena.graph.Node graphIRI, org.apache.jena.graph.Triple from, org.apache.jena.graph.Triple to)
SecurityEvaluator
Update is a special case since it modifies one triple to be another. So the user must have permissions to change the "from" triple into the "to" triple.
evaluateUpdate
in interface SecurityEvaluator
principal
- The principal that is attempting the action.graphIRI
- The IRI of the graph to the action is being taken upon. May be
ANY
.from
- The triple to be changedto
- The value to change it to.public void setPrincipal(String userName)
public Principal getPrincipal()
SecurityEvaluator
getPrincipal
in interface SecurityEvaluator
public boolean isPrincipalAuthenticated(Object principal)
SecurityEvaluator
isPrincipalAuthenticated
in interface SecurityEvaluator
principal
- The principal to check.Licensed under the Apache License, Version 2.0