Hey Irv,

That looks like my code. You're right that the isAuthorized variable is
unused. I thought I was going to need it but later decided to put a cfreturn
in each condition instead. I'll remove the variable from the code in the
repo.

Thanks,

-- Dennis


On Fri, Jul 30, 2010 at 10:55 PM, Irv Wilson <[email protected]> wrote:

> Hello!
>
> I'm trying to run thru the security example I found online for model
> glue.  It appears as it's written it works only for CF9.  As I'm using
> CF8 I decided to go thru it line by line and get rid of the cfscript
> while I'm at it.  Where I'm stuck is the following function
> "checkaccess".  Question is on the var "IsAuthorized" - is it supposed
> ot be there?  It's a local var and I don't see where it's used.
>
>
>         <cffunction name="checkAccess" access="Public"
> returnType="void" output="false">
>                <cfset var authorizedRoles =
> arguments.event.getArgument("authorizedRoles", "*") />
>                <cfset var isAuthorized = false />
>
>                <!--- Is the current user logged in?  --->
>                <cfif not beans.loginSessionManager.isLoggedIn() >
>                        <cfset arguments.event.addResult("NotLoggedIn") />
>                        <cfreturn>
>         </cfif>
>                <!--- An authorizedRoles argument of "*" means any logged-in
> user is authorized --->
>                <cfif (authorizedRoles is "*") >
>                        <cfreturn>
>                </cfif>
>                <!--- Is the current user in an authorized role?  --->
>                <cfif not
> beans.loginSessionManager.isInAnyRole(authorizedRoles) >
>                        <cfset arguments.event.addResult("NotAuthorized") />
>                </cfif>
>     </cffunction>
>
>

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

Reply via email to