Neptune 1.0 Beta 3 Documentation: Registering a Security Service

Neptune Information

Download from RIA Forge

Registering a Security Service

The security service for Neptune should be registered with the framework itself and with the Manager.cfc component running on the framework.

Register with Neptune

The security service must be registered with the framework so that the page controllers have access to it via the framework and so that each program can register its security requirements.

To register the component with the framework, make sure that the "component" element for the security service has a 'special="security"' attribute. If, however, the "name" attribute for the component is "Security" and no component has a special attribute of "Security" then this is not needed.

Example:

<component name="Security" path="admin.admins.model.Security" special="Security">
	<argument name="SessionMgr" />
	<argument name="Manager" />
</component>

Register with Manager.cfc

The security service must be registered with Manager.cfc so that each table can register its permissions and so that each list/edit page for a table can automatically be secured based on those permissions.

To register the component with Manager.cfc, pass the component itself into the "Security_Register" method of Manager.cfc. Typically this would be done by passing Manager.cfc to the "init" method of the security component and calling it from there.

Example:

<cffunction name="init" access="public" returntype="any" output="no">
	<cfargument name="Manager" type="any" required="yes">
	<cfargument name="SessionMgr" type="any" required="yes">
	
	<cfset initInternal(argumentcollection=arguments)>
	
	<cfset Variables.Manager.Security_Register(This)>
	
	<cfreturn This>
</cffunction>