You could start off with all of them being private, then put the ones you want in the "this" scope to make them public (or put all ones not private in the this scope).
<cfset this.methodName = variables.methodName> That should work to make a private method public. Just keep in mind that the meta data of your component won't reflect that. > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Behalf Of Suyer, Ed > Sent: Thursday, March 04, 2004 8:19 AM > To: '[EMAIL PROTECTED]' > Subject: [CFCDev] Dynamically set function access inside a CFC > > > > Hi folks, > > Does anyone know of a way to set the access level of a cfc > function when the > object is created? > > Here's what I tried (this does not work): > > foo.cfc -> > <cfcomponent displayname="foo"> > <cffunction name="init" access="public" returntype="foo" > output="false"> > <!---cfset this.bar.access = "private" /---> <!--- this > doesn't work either ---> > <cfset temp = StructUpdate(this.bar, "access", "private")> > <cfreturn this /> > </cffunction> > > <cffunction name="bar" access="public" returntype="string" > output="false"> > <cfreturn "hello world!" /> > </cffunction> > </cfcomponent> > > main.cfm -> > <cfset foo = createObject("component","foo").init() /> > <cfdump var="#foo#"> > > > What I'm after is to filter the properties that are available when the > object is constructed (by making the setter/getter methods private for the > properties that are not available). Ultimately I'd like to marry a filter > object with foo and return a component which makes available the > properties > (via the setters/getters) defined by the filter. > > Any thoughts? > > Ed. ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
