Packageorg.springextensions.actionscript.security
SVN browsingSimpleStageSecurityManager.as
FisheyeSimpleStageSecurityManager.as
Classpublic class SimpleStageSecurityManager
InheritanceSimpleStageSecurityManager Inheritance flash.events.EventDispatcher
ImplementsISecurityManager

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



Documentation reference: the simplesecuritystageprocessor class

Sample project: security (source)


Public Properties
 PropertyDefined by
  accessStrategy : AccessStrategy
The AccessStrategy that determines which property on the list of managed UIComponents will be used to restrict access.
SimpleStageSecurityManager
  objects : Dictionary
An array of UIComponents whose access is restricted by the current SimpleStageSecurityManager.
SimpleStageSecurityManager
  rights : Array
An array of strings that represent the right names that are applicable to the current IMembershipOwner
SimpleStageSecurityManager
  roles : Array
An array 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
  
checkObjectDictionary(objects:Dictionary):void
Checks if all the objects in the specified Dictionary are of type UIComponent.
SimpleStageSecurityManager
  
isInArray(sourceArray:Array, checkedArray:Array):Boolean
Returns true if one of the items in the checkedArray exists in the sourceArray.
SimpleStageSecurityManager
  
Returns true if the specified IMembershipOwner has any rights equal to the current SimpleStageSecurityManager rights.
SimpleStageSecurityManager
  
isInRoles(owner:IMembershipOwner):Boolean
Returns true if the specified IMembershipOwner has any roles equal to the current SimpleStageSecurityManager roles.
SimpleStageSecurityManager
  
restrictAccess(component:UIComponent, 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 UIComponents that the current SimpleStageSecurityManager manages by invoking the restrictAccess() for each UIComponents
SimpleStageSecurityManager
Property detail
accessStrategyproperty
accessStrategy:AccessStrategy  [read-write]

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

Implementation
    public function get accessStrategy():AccessStrategy
    public function set accessStrategy(value:AccessStrategy):void
objectsproperty 
objects:Dictionary  [read-write]

An array of UIComponents whose access is restricted by the current SimpleStageSecurityManager.

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

See also

rightsproperty 
rights:Array  [read-write]

An array of strings that represent the right names that are applicable to the current IMembershipOwner

Implementation
    public function get rights():Array
    public function set rights(value:Array):void
rolesproperty 
roles:Array  [read-write]

An array of strings that represent the role names that are applicable to the current IMembershipOwner

Implementation
    public function get roles():Array
    public function set roles(value:Array):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 UIComponents 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
checkObjectDictionary()method 
protected function checkObjectDictionary(objects:Dictionary):void

Checks if all the objects in the specified Dictionary are of type UIComponent.

Parameters
objects:Dictionary — The array of objects that will be checked

Throws
— If one or more of the objects is not of type UIComponent.
isInArray()method 
protected function isInArray(sourceArray:Array, checkedArray:Array):Boolean

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

Parameters
sourceArray:Array — The array of which one or more items need to be contained in the checkedArray.
 
checkedArray:Array — 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.
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
restrictAccess()method 
protected function restrictAccess(component:UIComponent, 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:UIComponent — 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 UIComponents that the current SimpleStageSecurityManager manages by invoking the restrictAccess() for each UIComponents

Parameters
state:Boolean