OOPhoto: Implementing Security In An Object Oriented Application - Round I

<cffunction
	name="ConfirmPermissions"
	access="public"
	returntype="void"
	output="false"
	hint="I check to see if the given user can perform the given action. If not, I rase an exception.">
 
	<!--- Define arguments. --->
	<cfargument
		name="User"
		type="any"
		required="true"
		hint="I am the user in question."
		/>
 
	<cfargument
		name="Action"
		type="string"
		required="true"
		hint="I am the action being performed."
		/>
 
	<cfargument
		name="Target"
		type="any"
		required="true"
		hint="I am the target object upon which the action is being performed."
		/>
 
 
	<!---
		Check to see if the user can perform the given action
		on the given target.
	--->
	<cfif THIS.CheckPermissions(
		ARGUMENTS.User,
		ARGUMENTS.Action,
		ARGUMENTS.Target
		)>
 
		<!--- The user can perform the given action. --->
		<cfreturn />
 
	<cfelse>
 
		<!---
			The user cannot perform the given action on the given
			target. Raise a security exception.
		--->
		<cfthrow
			type="OOPhoto.AccessDenied"
			message="You do not have permission to perform this action."
			detail="You do not have permissions to perform the action, #ARGUMENTS.Action#, on the given object."
			/>
 
	</cfif>
</cffunction>

For Cut-and-Paste