| Package | org.springextensions.actionscript.security |
| SVN browsing | SimpleSecurityManagerFactory.as |
| Fisheye | SimpleSecurityManagerFactory.as |
| Class | public class SimpleSecurityManagerFactory |
| Implements | ISecurityManagerFactory |
ISecurityManagerFactory that holds the roles and rights data for a specified list of UIComponents
in a dictionary with a UIComponent id as its key and an IMembershipOwner as its value.
When a UIComponent is passed to its createInstance() the component's id is looked up in this
dictionary, and if a valid IMembershipOwner is found an ISecurityManager is created for the UIComponent
and added to the managersList.
| Property | Defined by | ||
|---|---|---|---|
| managersList : Array [read-only]
An Array of
ISecurityManagers that have been created by the current SimpleSecurityManagerFactory
| SimpleSecurityManagerFactory | ||
| membershipData : Dictionary
A
Dictionary containing membershipData, the key should be the id of
an UIComponent on the stage, the value is MembershipAccessData instance
whose roles and rights arrays and AcccessStrategy will be assigned to the ISecurityManager
that is created for the stage component. | SimpleSecurityManagerFactory | ||
| membershipOwner : IMembershipOwner
Typically an | SimpleSecurityManagerFactory | ||
| Property | Defined by | ||
|---|---|---|---|
| componentCache : Dictionary
A Dictionary instance used to keep track of the stage components that have already been
processed by the current
SimpleSecurityManagerFactory. | SimpleSecurityManagerFactory | ||
| Method | Defined by | ||
|---|---|---|---|
|
Creates a new
SimpleSecurityManagerFactory instance. | SimpleSecurityManagerFactory | ||
|
createInstance(object:Object):ISecurityManager
Creates a new
ISecurityManager for the specified object when possible,
returns the newly created instance or null. | SimpleSecurityManagerFactory | ||
|
hasAccess(objectId:String):Boolean
| SimpleSecurityManagerFactory | ||
| Method | Defined by | ||
|---|---|---|---|
|
bindMembershipOwner():void
Adds event listeners for the
rolesChanged and rightsChanged events on the
membershipOwner when its not null. | SimpleSecurityManagerFactory | ||
|
createSecurityManager(component:UIComponent):ISecurityManager
If an
IMembershipOwner exists in the membershipData Dictionary
for the id of the specified UIComponent a new ISecurityManager
instance is created for the specified UIComponent using the IMembershipOwner instance. | SimpleSecurityManagerFactory | ||
|
membershipOwnerChange_handler(event:Event = null):void
Calls the
checkMembership() method on all the ISecurityManager instances that
the current SimpleSecurityManager has created. | SimpleSecurityManagerFactory | ||
|
unbindMembershipOwner():void
Removes event listeners for the
rolesChanged and rightsChanged events from the
membershipOwner when its not null. | SimpleSecurityManagerFactory | ||
| componentCache | property |
protected var componentCache:Dictionary
A Dictionary instance used to keep track of the stage components that have already been
processed by the current SimpleSecurityManagerFactory. This Dictionary
instance is created with the weakKeys constructor argument set to true
and will therefore not cause any memory leaks should any of the stage components be removed
from the permanently.
| managersList | property |
managersList:Array [read-only]
An Array of ISecurityManagers that have been created by the current SimpleSecurityManagerFactory
public function get managersList():Array
| membershipData | property |
membershipData:Dictionary [read-write]
A Dictionary containing membershipData, the key should be the id of
an UIComponent on the stage, the value is MembershipAccessData instance
whose roles and rights arrays and AcccessStrategy will be assigned to the ISecurityManager
that is created for the stage component.
public function get membershipData():Dictionary
public function set membershipData(value:Dictionary):void
| membershipOwner | property |
membershipOwner:IMembershipOwner [read-write]
IMembershipOwner instance that will be monitored and whose changes will be used to
let the ISecurityManagers evaluate access to the objects they manage.
Typically an ISecurityManagerFactory will call the checkMembership() method
on each ISecurityManager it created when this property changes.
public function get membershipOwner():IMembershipOwner
public function set membershipOwner(value:IMembershipOwner):void
| SimpleSecurityManagerFactory | () | constructor |
public function SimpleSecurityManagerFactory()
Creates a new SimpleSecurityManagerFactory instance.
| bindMembershipOwner | () | method |
protected function bindMembershipOwner():void
Adds event listeners for the rolesChanged and rightsChanged events on the
membershipOwner when its not null.
| createInstance | () | method |
public function createInstance(object:Object):ISecurityManager
Creates a new ISecurityManager for the specified object when possible,
returns the newly created instance or null.
object:Object — The specified object for which an ISecurityManager might be created.
|
ISecurityManager —
A new ISecurityManager instance or null.
|
| createSecurityManager | () | method |
protected function createSecurityManager(component:UIComponent):ISecurityManager
If an IMembershipOwner exists in the membershipData Dictionary
for the id of the specified UIComponent a new ISecurityManager
instance is created for the specified UIComponent using the IMembershipOwner instance.
component:UIComponent — The specified UIComponent
|
ISecurityManager —
A new ISecurityManager instance or null if a valid IMembershipOwner wasn't found
|
| hasAccess | () | method |
public function hasAccess(objectId:String):BooleanParameters
objectId:String |
Boolean |
| membershipOwnerChange_handler | () | method |
protected function membershipOwnerChange_handler(event:Event = null):void
Calls the checkMembership() method on all the ISecurityManager instances that
the current SimpleSecurityManager has created.
event:Event (default = null) |
See also
| unbindMembershipOwner | () | method |
protected function unbindMembershipOwner():void
Removes event listeners for the rolesChanged and rightsChanged events from the
membershipOwner when its not null.