com.bea.security.entitlements.admin.rbac
Class RoleNode

java.lang.Object
  extended byorg.apache.myfaces.custom.tree2.TreeNodeBase
      extended bycom.bea.security.entitlements.admin.rbac.TreeNodeWithSelection
          extended bycom.bea.security.entitlements.admin.rbac.BaseTreeNode
              extended bycom.bea.security.entitlements.admin.rbac.AttributableEntitlementNode
                  extended bycom.bea.security.entitlements.admin.rbac.RolePermissionSetNode
                      extended bycom.bea.security.entitlements.admin.rbac.RoleNode
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable, org.apache.myfaces.custom.tree2.TreeNode

public class RoleNode
extends RolePermissionSetNode

Role Node represents a role in the EUI tree. The node will wrap our RBAC Role Node to be used by the entitlements front end. A role represents a job function within the context of an organization. Roles have permissions and users assigned to them. Roles can have hierarchy of children and can have membership rules and associated attributes.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.bea.security.entitlements.admin.rbac.BaseTreeNode
IDENTITY_DIRECTORY_NODE, IDENTITY_NODE, NAVIGATION_NODE, PERMISSION_NODE, PERMISSION_SET_NODE, REPORTING_NODE, RESOURCE_NODE, ROLE_NODE, SOD_NODE
 
Constructor Summary
RoleNode(com.bea.ales.rbac.RBAC_Role role, boolean isleaf)
          Constructor to create a new EUI role node
RoleNode(RoleNode parent, com.bea.ales.rbac.RBAC_Role role, boolean isleaf)
          Constructor to create a new EUI role node
RoleNode(java.lang.String name, boolean isleaf)
          Constructor to create a new EUI role node
 
Method Summary
 void addDeniedRole(RoleNode r)
          Add a given role to the denied role list
 java.lang.String addPermissions()
          Add permissions method.
 java.lang.String cancelModifyPermissions()
          Handle when the cancel button is clicked for modify perms.
 java.lang.String cancelModifyRule()
          When canceling the modification of a rule, If the new rule is canceled, make sure we delete the rule.
 java.lang.String finishedModifyAttribute()
          When finished modifying a rule, make sure that if it was a new rule we re-set our state back to false so that on cancel, we don't accidentally delete an existing rule.
 java.lang.String finishedModifyRule()
          When finished modifying a rule, make sure that if it was a new rule we re-set our state back to false so that on cancel, we don't accidentally delete an existing rule.
 java.lang.String finishModifyPermissions()
          Action listern when Ok button on addPerm2Role gets clicked.
 java.util.List getAllRbacPermissions()
          Get All RBAC Permission objects associated to this node
 java.util.List getAttributes()
          Get all Attributes for this node, using QueryType.ALL
 java.util.List getChildren()
          Implements JSF TreeNodeBase getChildren()
 java.util.List getCurrentAvailablePermissions()
          Return currently available permission for this node
 java.util.List getCurrentIndividualPermissions()
          Get just the individual permissions for this node
 MembershipRuleElement getCurrentRule()
          Return current membership rule
 java.util.List getDeniedPermissions()
          Retrieve list of denied RBAC permissions
 java.util.List getDeniedRbacPermissions()
          Get a list of denied RBAC Permission objects
 java.util.List getDeniedRoles()
          Get a list of all denied roles
 java.util.List getDirectAttributes()
          Get Direct Atttributes for this Role node
 java.util.List getDirectRbacPermissions()
          Accessor method to get direct permissions for this role node
 java.util.List getDirectRbacPermissionSets()
          Accessor method to get direct permissions sets for this role node
 java.lang.String getFullName()
          Name of the role
 java.util.List getIndividualPermissions()
          Get just the individual permissions for this node
 java.util.List getInheritedPermissions()
          Get all inherited pemissions for this node
 boolean getModifyMemberRuleFinished()
          Get the state of the modify member rule, session state holder
 java.lang.String getNodeType()
          Return role node type constant
 java.lang.String getPermFilter()
          Permission filter for this node
 int getPermFromIdx()
          Id of permission from From table
 PermissionSetNode getPermissionSets()
          Get permission set for this node
 int getPermToIdx()
          Id of permission from To table
 int getPermTotal()
          Return permission total, sum of original avialbalbe permissions minus permissions that are to be removed.
 org.apache.myfaces.custom.tree2.TreeModel getpSetTreeModel()
          This is used as data for paset tree in rolepermissions.jsp
 com.bea.ales.rbac.RBAC_Role getRbacRole()
          Get RBAC_role backed by this role node
 java.util.List getRules()
          Get all memebership rules for this role node
 int getRulesIdx()
          Id or index for the selected rule
 java.util.List getSelectedAllowedPermissions()
          Get list of allowed permission objects for this node
 java.util.List getSelectedAvailablePermissions()
          Get list of Available permission objects for this node
 java.util.List getSelectedDeniedPermissions()
          Get list of Denied permission objects for this node
 java.util.List getSelectedIndividualPermissions()
          Get list of Individual permission objects for this node
 PermissionSetNode getSelectedPermissionSet()
          Get currently selected permission set object
 boolean isEditRule()
          Status of edit rule
 boolean isHiddenforSod()
          Status of the hidden for SOD flag
 boolean isNewRule()
          Check if new rule
 java.lang.String modifyPermissions()
          Used as a navigation case when opening the popup window on the permissions tab.
 java.lang.String newRuleAction()
          Create a new rule to be edited in the UI.
 void processAllowAction(javax.faces.event.ActionEvent event)
          Allow permissions on a specific node.
 void processDenyAction(javax.faces.event.ActionEvent event)
          Deny permissions on a specific node.
 void processPermissionSetSelect(javax.faces.event.ActionEvent event)
          This event listener fires when a node is selected on the permission set tree.
 java.lang.String removeCurrentAttribute()
          Remove the currently selected rule from the list
 java.lang.String removeCurrentRule()
          Remove current rule from DB
 java.lang.String removeCurrentRuleFromList()
          Remove the currently selected rule from the list
 void removeDeniedRole(RoleNode r)
          Remove a role from the deined riole
 java.lang.String removePermissions()
          Remove permissions method.
 void setCurrentRule(MembershipRuleElement currentRule)
          Set a new membership rule element
 void setDeniedPermissions(java.util.List deniedPermissions)
          Set a new list of denined permission list
 void setDirectRbacPermissionSets(java.util.List newRbacPermissionSets)
          Set a new set of RBAC Permission set nodes
 void setEditRule(boolean editRule)
          Set a new edit rule
 void setHiddenforSod(boolean hiddenforSod)
          Set new status for hiddent for SOD
 void setIndividualPermissions(java.util.List individualPermissions)
          Set a new set of Individual permissions for this node
 void setModifyMemberRuleFinished(boolean isFinished)
          Set statis of modfiy member rule, session state holder
 void setNewRule(boolean newRule)
          Set new rule falg
 void setPermFilter(java.lang.String filter)
          Set new permossion filter for this node
 void setPermissionSets(PermissionSetNode pSets)
          Set new PermissionSetNode for this role node
 void setPSetTreeModel(org.apache.myfaces.custom.tree2.TreeModel setTreeModel)
          Set a new model for the permission set for this role
 void setRules(java.util.List rules)
          Set new set of rules for this node
 void setRulesIdx(int rulesIdx)
          Set the currently selected rule in the member rules table of the UI.
 void setSelectedAllowedPermissions(java.util.List selectedAllowedPermissions)
          Set list of allowed permission objects for this node
 void setSelectedAvailablePermissions(java.util.List selectedNewPermissions)
          Set list of Available permission objects for this node
 void setSelectedDeniedPermissions(java.util.List selectedDeniedPermissions)
          Set list of Denied permission objects for this node
 void setSelectedIndividualPermissions(java.util.List selectedPermissions)
          Set list of Individual permission objects for this node
 void setSelectedPermissionSet(PermissionSetNode selectedPermissionSet)
          Set new selected permission set node
 
Methods inherited from class com.bea.security.entitlements.admin.rbac.RolePermissionSetNode
decreasePermissionIndex, increasePermissionIndex
 
Methods inherited from class com.bea.security.entitlements.admin.rbac.AttributableEntitlementNode
cancelModifyAttribute, getCurrentAttribute, isNewAttribute, newAttributeAction, removeCurrentAttributeFromList, setAttributes, setAttrIdx, setCurrentAttribute, setNewAttribute
 
Methods inherited from class com.bea.security.entitlements.admin.rbac.TreeNodeWithSelection
compareTo, getNodeByName, getParent, isSelected, removeNode, setChildrenSelectedRecursively, setNeedUpdateChildren, setParent, setSelected
 
Methods inherited from class org.apache.myfaces.custom.tree2.TreeNodeBase
getChildCount, getDescription, getIdentifier, getType, isLeaf, setDescription, setIdentifier, setLeaf, setType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoleNode

public RoleNode(com.bea.ales.rbac.RBAC_Role role,
                boolean isleaf)
Constructor to create a new EUI role node

Parameters:
role - RBAC role to wrap
isleaf - true if leaf node, false otherwise

RoleNode

public RoleNode(RoleNode parent,
                com.bea.ales.rbac.RBAC_Role role,
                boolean isleaf)
Constructor to create a new EUI role node

Parameters:
role - RBAC role to wrap
isleaf - true if leaf node, false otherwise

RoleNode

public RoleNode(java.lang.String name,
                boolean isleaf)
Constructor to create a new EUI role node

Parameters:
name - role name to create
isleaf - true if leaf node, false otherwise
Method Detail

addDeniedRole

public void addDeniedRole(RoleNode r)
Add a given role to the denied role list

Parameters:
r - role to deny

addPermissions

public java.lang.String addPermissions()
Add permissions method. Intialize the add permissions variable with new permissions to add Called by the add permissions popup. For each selected new permission add it to the current role.

Specified by:
addPermissions in class RolePermissionSetNode

cancelModifyPermissions

public java.lang.String cancelModifyPermissions()
Handle when the cancel button is clicked for modify perms.

Returns:
null mostly

cancelModifyRule

public java.lang.String cancelModifyRule()
When canceling the modification of a rule, If the new rule is canceled, make sure we delete the rule.

Returns:
null mostly

finishedModifyAttribute

public java.lang.String finishedModifyAttribute()
When finished modifying a rule, make sure that if it was a new rule we re-set our state back to false so that on cancel, we don't accidentally delete an existing rule.

Returns:
null mostly

finishedModifyRule

public java.lang.String finishedModifyRule()
When finished modifying a rule, make sure that if it was a new rule we re-set our state back to false so that on cancel, we don't accidentally delete an existing rule.

Returns:
null mostly

finishModifyPermissions

public java.lang.String finishModifyPermissions()
Action listern when Ok button on addPerm2Role gets clicked.

Returns:
null mostly

getAllRbacPermissions

public java.util.List getAllRbacPermissions()
Get All RBAC Permission objects associated to this node

Specified by:
getAllRbacPermissions in class RolePermissionSetNode
Returns:
ArrayList of RBAC_Permission objects

getAttributes

public java.util.List getAttributes()
Get all Attributes for this node, using QueryType.ALL

Returns:
list of com.bea.security.entitlements.admin.rbac.AttributeElement objects

getChildren

public java.util.List getChildren()
Implements JSF TreeNodeBase getChildren()

Returns:
List array list of children for this role, instance of RoleNode objects

getCurrentAvailablePermissions

public java.util.List getCurrentAvailablePermissions()
Return currently available permission for this node

Specified by:
getCurrentAvailablePermissions in class RolePermissionSetNode
Returns:
list of SelectItem objects with permission name and instance

getCurrentIndividualPermissions

public java.util.List getCurrentIndividualPermissions()
Get just the individual permissions for this node

Specified by:
getCurrentIndividualPermissions in class RolePermissionSetNode
Returns:
array list of SelectItem objects

getCurrentRule

public MembershipRuleElement getCurrentRule()
Return current membership rule

Returns:
current set membership rule

getDeniedPermissions

public java.util.List getDeniedPermissions()
Retrieve list of denied RBAC permissions

Returns:
Array list of SelectItem objects with RBAC_Permission and permission name

getDeniedRbacPermissions

public java.util.List getDeniedRbacPermissions()
Get a list of denied RBAC Permission objects

Returns:
RBAC_Permission obhects marked deined for this role

getDeniedRoles

public java.util.List getDeniedRoles()
Get a list of all denied roles

Returns:
ArrayList of denied RBAC_Role roles

getDirectAttributes

public java.util.List getDirectAttributes()
Get Direct Atttributes for this Role node

Specified by:
getDirectAttributes in class RolePermissionSetNode
Returns:
List of AttributeElements for this node

getDirectRbacPermissions

public java.util.List getDirectRbacPermissions()
Accessor method to get direct permissions for this role node

Specified by:
getDirectRbacPermissions in class RolePermissionSetNode
Returns:
array list of RBAC_Permission objects

getDirectRbacPermissionSets

public java.util.List getDirectRbacPermissionSets()
Accessor method to get direct permissions sets for this role node

Returns:
array list of RBAC_PermissionSet objects

getFullName

public java.lang.String getFullName()
Name of the role

Returns:
role name

getIndividualPermissions

public java.util.List getIndividualPermissions()
Get just the individual permissions for this node

Specified by:
getIndividualPermissions in class RolePermissionSetNode
Returns:
array list of RBAC_Permission objects

getInheritedPermissions

public java.util.List getInheritedPermissions()
Get all inherited pemissions for this node

Specified by:
getInheritedPermissions in class RolePermissionSetNode
Returns:
array list of RBAC_Permission objects

getModifyMemberRuleFinished

public boolean getModifyMemberRuleFinished()
Get the state of the modify member rule, session state holder

Returns:
true of set, false otherwise

getNodeType

public java.lang.String getNodeType()
Return role node type constant

Specified by:
getNodeType in class BaseTreeNode
Returns:
returns BaseTreeNode.ROLE_NODE for this node

getPermFilter

public java.lang.String getPermFilter()
Permission filter for this node

Returns:
Returns the permFilter.

getPermFromIdx

public int getPermFromIdx()
Id of permission from From table

Returns:
id of permission

getPermissionSets

public PermissionSetNode getPermissionSets()
Get permission set for this node

Returns:
PermissionSetNode for this object

getPermToIdx

public int getPermToIdx()
Id of permission from To table

Returns:
id of permission

getPermTotal

public int getPermTotal()
Return permission total, sum of original avialbalbe permissions minus permissions that are to be removed.

Returns:
total permissions

getpSetTreeModel

public org.apache.myfaces.custom.tree2.TreeModel getpSetTreeModel()
This is used as data for paset tree in rolepermissions.jsp

Returns:
model currently used for permission set for this role

getRbacRole

public com.bea.ales.rbac.RBAC_Role getRbacRole()
Get RBAC_role backed by this role node

Returns:
RBAC_Role for this node

getRules

public java.util.List getRules()
Get all memebership rules for this role node

Returns:
Array list of MembershipRuleElement objects for this node

getRulesIdx

public int getRulesIdx()
Id or index for the selected rule

Returns:

getSelectedAllowedPermissions

public java.util.List getSelectedAllowedPermissions()
Get list of allowed permission objects for this node

Returns:
list of allowed RBAC_Permission objects

getSelectedAvailablePermissions

public java.util.List getSelectedAvailablePermissions()
Get list of Available permission objects for this node

Returns:
list of allowed RBAC_Permission objects

getSelectedDeniedPermissions

public java.util.List getSelectedDeniedPermissions()
Get list of Denied permission objects for this node

Returns:
list of allowed RBAC_Permission objects

getSelectedIndividualPermissions

public java.util.List getSelectedIndividualPermissions()
Get list of Individual permission objects for this node

Returns:
list of allowed RBAC_Permission objects

getSelectedPermissionSet

public PermissionSetNode getSelectedPermissionSet()
Get currently selected permission set object

Returns:
selected PermissionSetNode

isEditRule

public boolean isEditRule()
Status of edit rule

Returns:
true if set, false otherwise

isHiddenforSod

public boolean isHiddenforSod()
Status of the hidden for SOD flag

Returns:
true if set, false otherwise

isNewRule

public boolean isNewRule()
Check if new rule

Returns:
true if new, false otherwise

modifyPermissions

public java.lang.String modifyPermissions()
Used as a navigation case when opening the popup window on the permissions tab. When the modify button is clicked, if a permission set is selected then we take the user to the permission set selection window. If not, we take the user to the individual permission window.

Returns:
"ModifyPermissionSets" for permissions sets, "ModifyPermissions" for permissions

newRuleAction

public java.lang.String newRuleAction()
                               throws com.bea.ales.rbac.RBACException
Create a new rule to be edited in the UI.

Returns:
"Success" Once created the success return value causes the popup to be forwarded to the modifymemberrule.jsp page which will be pointing to the newly created rule.
Throws:
com.bea.ales.rbac.RBACException

processAllowAction

public void processAllowAction(javax.faces.event.ActionEvent event)
                        throws javax.faces.event.AbortProcessingException
Allow permissions on a specific node. For each denied permission selected, allow the permission on the node. Right now we are just moving the node from the denied list to the allowed list.

Parameters:
event - ActionEvent with RBAC_Permission
Throws:
javax.faces.event.AbortProcessingException

processDenyAction

public void processDenyAction(javax.faces.event.ActionEvent event)
                       throws javax.faces.event.AbortProcessingException
Deny permissions on a specific node. For each allowed permission selected, deny the permission on the node. Right now we are just moving the node from the allowed list to the denied list.

Parameters:
event - ActionEvent with RBAC_Permission
Throws:
javax.faces.event.AbortProcessingException

processPermissionSetSelect

public void processPermissionSetSelect(javax.faces.event.ActionEvent event)
                                throws javax.faces.event.AbortProcessingException
This event listener fires when a node is selected on the permission set tree. It will cause all the data associated with the node selected to be represented by the GUI

Parameters:
event - ActionEvent from event
Throws:
javax.faces.event.AbortProcessingException

removeCurrentAttribute

public java.lang.String removeCurrentAttribute()
Remove the currently selected rule from the list

Returns:
null mostly

removeCurrentRule

public java.lang.String removeCurrentRule()
Remove current rule from DB

Returns:
null mostly

removeCurrentRuleFromList

public java.lang.String removeCurrentRuleFromList()
Remove the currently selected rule from the list

Returns:
null mostly

removeDeniedRole

public void removeDeniedRole(RoleNode r)
Remove a role from the deined riole

Parameters:
r - role to remove from list

removePermissions

public java.lang.String removePermissions()
Remove permissions method. Called by the add permissions popup. For each selected permission remove it to the current role.

Specified by:
removePermissions in class RolePermissionSetNode
Returns:
null mostly

setCurrentRule

public void setCurrentRule(MembershipRuleElement currentRule)
Set a new membership rule element

Parameters:
currentRule - new rule to set

setDeniedPermissions

public void setDeniedPermissions(java.util.List deniedPermissions)
Set a new list of denined permission list

Parameters:
deniedPermissions - list of select items with RBAC_Permission and permission name

setDirectRbacPermissionSets

public void setDirectRbacPermissionSets(java.util.List newRbacPermissionSets)
Set a new set of RBAC Permission set nodes

Parameters:
newRbacPermissionSets -

setEditRule

public void setEditRule(boolean editRule)
Set a new edit rule

Parameters:
editRule - true to set false otherwise

setHiddenforSod

public void setHiddenforSod(boolean hiddenforSod)
Set new status for hiddent for SOD

Parameters:
hiddenforSod - true to set, false otherwise

setIndividualPermissions

public void setIndividualPermissions(java.util.List individualPermissions)
Set a new set of Individual permissions for this node

Parameters:
individualPermissions - permission to set

setModifyMemberRuleFinished

public void setModifyMemberRuleFinished(boolean isFinished)
Set statis of modfiy member rule, session state holder

Parameters:
isFinished - true or false

setNewRule

public void setNewRule(boolean newRule)
Set new rule falg

Parameters:
newRule - true to set, false otherwise

setPermFilter

public void setPermFilter(java.lang.String filter)
Set new permossion filter for this node

Parameters:
filter - filter to set.

setPermissionSets

public void setPermissionSets(PermissionSetNode pSets)
Set new PermissionSetNode for this role node

Parameters:
pSets - PermissionSetNode to set

setPSetTreeModel

public void setPSetTreeModel(org.apache.myfaces.custom.tree2.TreeModel setTreeModel)
Set a new model for the permission set for this role

Parameters:
setTreeModel - model to set

setRules

public void setRules(java.util.List rules)
Set new set of rules for this node


setRulesIdx

public void setRulesIdx(int rulesIdx)
Set the currently selected rule in the member rules table of the UI.


setSelectedAllowedPermissions

public void setSelectedAllowedPermissions(java.util.List selectedAllowedPermissions)
Set list of allowed permission objects for this node

Parameters:
selectedAllowedPermissions - list of allowed RBAC_Permission objects

setSelectedAvailablePermissions

public void setSelectedAvailablePermissions(java.util.List selectedNewPermissions)
Set list of Available permission objects for this node


setSelectedDeniedPermissions

public void setSelectedDeniedPermissions(java.util.List selectedDeniedPermissions)
Set list of Denied permission objects for this node


setSelectedIndividualPermissions

public void setSelectedIndividualPermissions(java.util.List selectedPermissions)
Set list of Individual permission objects for this node


setSelectedPermissionSet

public void setSelectedPermissionSet(PermissionSetNode selectedPermissionSet)
Set new selected permission set node

Parameters:
selectedPermissionSet - new node to selected


Copyright © 2007 BEA Systems Inc. All Rights Reserved.