Packageorg.springextensions.actionscript.security.impl
Classpublic class SimpleStageSecurityManager
InheritanceSimpleStageSecurityManager Inheritance flash.events.EventDispatcher
Implements ISecurityManager

An ISecurityManager that restricts the access to a list of Objects, the way this restriction works is determined by an instance of the AccessStrategy enum.



Public Properties
 PropertyDefined By
  accessStrategy : AccessStrategy
The AccessStrategy that determines which property on the list of managed Objects will be used to restrict access.
SimpleStageSecurityManager
  objects : Dictionary
A Vector of Objects whose access is restricted by the current SimpleStageSecurityManager.
SimpleStageSecurityManager
  rights : Vector.<String>
A Vector of strings that represent the right names that are applicable to the current IMembershipOwner
SimpleStageSecurityManager
  roles : Vector.<String>
A Vector of strings that represent the role names that are applicable to the current IMembershipOwner
SimpleStageSecurityManager
Public Methods
 MethodDefined By
  
Creates a new SimpleStageSecurityManager instance.
SimpleStageSecurityManager
  
Checks the specified IMembershipOwner against the roles and rights of the current SimpleStageSecurityManager.
SimpleStageSecurityManager
Protected Methods
 MethodDefined By
  
Returns true if the specified IMembershipOwner has any rights equal to the current SimpleStageSecurityManager rights.
SimpleStageSecurityManager
  
Returns true if the specified IMembershipOwner has any roles equal to the current SimpleStageSecurityManager roles.
SimpleStageSecurityManager
  
isInVector(sourceArray:Vector.<String>, checkedArray:Vector.<String>):Boolean
Returns true if one of the items in the checkedArray exists in the sourceArray.
SimpleStageSecurityManager
  
restrictAccess(component:Object, strategy:AccessStrategy, state:Boolean):void
Sets a property whose name is specified by the AccessStrategy on the UIComponent to the value of the state argument.
SimpleStageSecurityManager
  
setAccess(state:Boolean):void
Sets a property determined by the accessStrategy to true or false (based on the state value) on all the Objects that the current SimpleStageSecurityManager manages by invoking the restrictAccess() for each UIComponents
SimpleStageSecurityManager
Property Detail
accessStrategyproperty
accessStrategy:AccessStrategy

The AccessStrategy that determines which property on the list of managed Objects will be used to restrict access.


Implementation
    public function get accessStrategy():AccessStrategy
    public function set accessStrategy(value:AccessStrategy):void
objectsproperty 
objects:Dictionary

A Vector of Objects whose access is restricted by the current SimpleStageSecurityManager.


Implementation
    public function get objects():Dictionary
    public function set objects(value:Dictionary):void

See also

SimpleStageSecurityManager.checkObjectArray()
rightsproperty 
rights:Vector.<String>

A Vector of strings that represent the right names that are applicable to the current IMembershipOwner


Implementation
    public function get rights():Vector.<String>
    public function set rights(value:Vector.<String>):void
rolesproperty 
roles:Vector.<String>

A Vector of strings that represent the role names that are applicable to the current IMembershipOwner


Implementation
    public function get roles():Vector.<String>
    public function set roles(value:Vector.<String>):void
Constructor Detail
SimpleStageSecurityManager()Constructor
public function SimpleStageSecurityManager(membershipOwner:IMembershipOwner = null)

Creates a new SimpleStageSecurityManager instance.

Parameters
membershipOwner:IMembershipOwner (default = null) — a IMembershipOwner instance whose roles and rights are applicable to the list of Objects that the current SimpleStageSecurityManager manages.
Method Detail
checkMembership()method
public function checkMembership(owner:IMembershipOwner):Boolean

Checks the specified IMembershipOwner against the roles and rights of the current SimpleStageSecurityManager. Roles take precendence in this, so if the roles list of the SimpleStageSecurityManager is not empty and the specified IMembershipOwner shares one or more roles true is returned, if not the same check is done for the rights.

Parameters

owner:IMembershipOwner

Returns
Boolean
isInRights()method 
protected function isInRights(owner:IMembershipOwner):Boolean

Returns true if the specified IMembershipOwner has any rights equal to the current SimpleStageSecurityManager rights.

Parameters

owner:IMembershipOwner

Returns
Boolean
isInRoles()method 
protected function isInRoles(owner:IMembershipOwner):Boolean

Returns true if the specified IMembershipOwner has any roles equal to the current SimpleStageSecurityManager roles.

Parameters

owner:IMembershipOwner

Returns
Boolean
isInVector()method 
protected function isInVector(sourceArray:Vector.<String>, checkedArray:Vector.<String>):Boolean

Returns true if one of the items in the checkedArray exists in the sourceArray.

Parameters

sourceArray:Vector.<String> — The array of which one or more items need to be contained in the checkedArray.
 
checkedArray:Vector.<String> — The array that needs to contain one or more items of the sourceArray.

Returns
Booleantrue if one of the items in the checkedArray exists in the sourceArray.
restrictAccess()method 
protected function restrictAccess(component:Object, strategy:AccessStrategy, state:Boolean):void

Sets a property whose name is specified by the AccessStrategy on the UIComponent to the value of the state argument.

Parameters

component:Object — The specified UIComponent
 
strategy:AccessStrategy — The specified AccessStrategy which determines which property will be set on the UIComponent
 
state:Boolean — The value of the property that will be set

setAccess()method 
protected function setAccess(state:Boolean):void

Sets a property determined by the accessStrategy to true or false (based on the state value) on all the Objects that the current SimpleStageSecurityManager manages by invoking the restrictAccess() for each UIComponents

Parameters

state:Boolean