spec/lib/generic_page_info.cfc
2025-06-02 16:16:51 +03:00

39 lines
1.3 KiB
Plaintext

<cfcomponent displayname="Generic Page Info" output="true">
<cfproperty name="entity" type="string"/>
<cfproperty name="key" type="string"/>
<cfproperty name="status" type="struct"/>
<cfproperty name="track" type="struct"/>
<cfproperty name="permission" type="integer"/>
<cfset this.PERMISSION_NONE=0/><!---duplicated in request scope--->
<cfset this.PERMISSION_READ=1/><!---duplicated in request scope--->
<cfset this.PERMISSION_WRITE=2/><!---duplicated in request scope--->
<cffunction name="init" access="public">
<cfargument name="entity" type="string" required="true"/>
<cfargument name="key" type="string" default="#arguments.entity#_id"/>
<cfargument name="track" type="struct" required="true"/>
<cfset this.entity=arguments.entity/>
<cfset this.key=arguments.key/>
<cfset this.track=arguments.track/>
<cfset this.permission=this.PERMISSION_NONE/>
<cfset this.status.errorState=false/>
<cfset this.status.errorMessage=""/>
<cfreturn this>
</cffunction>
<cffunction name="readPermitted" returntype="boolean">
<cfreturn (this.permission GE this.PERMISSION_READ)/>
</cffunction>
<cffunction name="writePermitted" returntype="boolean">
<cfreturn (this.permission GE this.PERMISSION_WRITE)/>
</cffunction>
<cffunction name="getType" returntype="string">
<cfreturn "generic"/>
</cffunction>
</cfcomponent>