|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnbi.xmlsec.xacml.profile.rbac.RBACPolicyElement
nbi.xmlsec.xacml.profile.rbac.Permission
This class implements a permission rule according to the XACML RBAC Profile.
It assigns permissions to access resources for given actions. The permission
may be represented as a Ruleor parsed from a Rule
representation.
| Field Summary | |
(package private) Apply |
condition
The condition of the permission rule or null |
(package private) static Logger |
logger
|
(package private) boolean |
permit
The effect of the permission rule (permit or deny) |
| Fields inherited from class nbi.xmlsec.xacml.profile.rbac.RBACPolicyElement |
|
| Constructor Summary | |
Permission(Rule rule)
Create a Permission instance from its Rulerepresentation. |
|
Permission(String domain,
String label,
boolean permit)
Create Permission instance. |
|
Permission(URI permId,
boolean permit)
Create an Permission instance. |
|
| Method Summary | |
boolean |
add(RBACPolicyElement element)
Adds the resources and actions of another Permission from the resources and actions of this permission respectively. |
boolean |
addAction(String action)
Adds an String action to the resource set. |
boolean |
addResource(String resource)
Adds an String resource to the resource set. |
boolean |
equals(Object obj)
Compares the specified object with this permission. |
Set |
getActions()
Gets the assigned actions of this this permission. |
Apply |
getCondition()
Gets the condition. |
Set |
getResources()
Gets the assigned resources of this this permission. |
boolean |
isPermit()
Gets the permit effect. |
void |
parse(PolicyTreeElement element)
Parses an permission from its Rulerepresentation. |
boolean |
remove(RBACPolicyElement element)
Removes the resources and actions of another Permission from the resources and actions of this permission respectively. |
boolean |
removeAction(String action)
Removes an String action from the action set. |
boolean |
removeResource(String resource)
Removes an String resource from the resource set. |
void |
setCondition(Apply condition)
Sets the condition. |
void |
setCondition(ConditionTypeBuilder conditionBuilder)
Sets the condition. |
void |
setPermit(boolean permit)
Sets the permit effect. |
PolicyTreeElement |
toPolicyTreeElement()
Returns the Rulerepresentation of the permission. |
String |
toString()
|
| Methods inherited from class nbi.xmlsec.xacml.profile.rbac.RBACPolicyElement |
getIdentifier, getTarget, hashCode, parse, setIdentifier, setIdentifier, setTarget |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
static Logger logger
boolean permit
Apply condition
| Constructor Detail |
public Permission(String domain,
String label,
boolean permit)
domain - Domain of the permission identifier.label - Label of the permission identifier.permit - true sets the effect to
DECISION_PERMIT,
false to
DECISION_DENY.
public Permission(URI permId,
boolean permit)
throws ParsingException
permId - Assignment identifier (domain:assignment:label).permit - true sets the effect to
DECISION_PERMIT,
false to
DECISION_DENY.
public Permission(Rule rule)
throws ParsingException
Rulerepresentation.
rule - Rulerepresentation.| Method Detail |
public boolean addResource(String resource)
resource - The resource to add.
true if the resource has been added succesfully,
false otherwise.public boolean removeResource(String resource)
resource - The resource to remove.
true if the resource has been removed succesfully,
false otherwise.public boolean addAction(String action)
action - The action to add.
true if the action has been added succesfully,
false otherwise.public boolean removeAction(String action)
action - The action to remove.
true if the action has been removed succesfully,
false otherwise.public boolean add(RBACPolicyElement element)
add in class RBACPolicyElementelement - The permission to add.
true if the any of the permission target objects
has been added succesfully, false otherwise.RBACPolicyElement.add(RBACPolicyElement)public boolean remove(RBACPolicyElement element)
remove in class RBACPolicyElementelement - The permission to remove.
true if the any of the permission target objects
has been removed succesfully, false otherwise.RBACPolicyElement.remove(RBACPolicyElement)public PolicyTreeElement toPolicyTreeElement()
Rulerepresentation of the permission.
toPolicyTreeElement in class RBACPolicyElement
public void parse(PolicyTreeElement element)
throws ParsingException
Rulerepresentation.
parse in class RBACPolicyElementelement - The rule to parse.
ParsingException - Indicates a malformed Rulerepresentation.public boolean isPermit()
true if the effect is set to
DECISION_PERMIT,
false if the effect is set to
DECISION_DENY.public void setPermit(boolean permit)
permit - true sets the effect to
DECISION_PERMIT,
false sets the effect to
DECISION_DENY.public void setCondition(Apply condition)
condition - The conditionpublic void setCondition(ConditionTypeBuilder conditionBuilder)
conditionBuilder - The conditionpublic Apply getCondition()
public Set getResources()
public Set getActions()
public boolean equals(Object obj)
equals in class RBACPolicyElementobj - Object to be compared for equality with this permission.
true if the specified Object is equal to this
permission.public String toString()
toString in class RBACPolicyElement
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||