Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
declaring two different security rules with the security interceptor..
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
namtax  
View profile  
 More options Jun 17, 3:08 pm
From: namtax <nam...@googlemail.com>
Date: Wed, 17 Jun 2009 12:08:29 -0700 (PDT)
Local: Wed, Jun 17 2009 3:08 pm
Subject: declaring two different security rules with the security interceptor..
Hi there

I have secured my application using the security interceptor using a
custom security object...

<cffunction name="userValidator">
Test if user is logged in
</cffunction>

Now is there any way of creating another custom security object with
different criteria, to secure alternative sections of my
application....for example

<cffunction name="userValidator2">
Check is user is logged in and called john
</cffunction>

Thanks


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ernst van der Linden  
View profile  
 More options Jun 17, 4:20 pm
From: Ernst van der Linden <evdlin...@gmail.com>
Date: Wed, 17 Jun 2009 22:20:01 +0200
Local: Wed, Jun 17 2009 4:20 pm
Subject: Re: [coldbox:2957] declaring two different security rules with the security interceptor..
securityrules.xml is used for securing different sections.

Normally you use ONE Validator object.

Ernst


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Luis Majano  
View profile  
 More options Jun 17, 5:04 pm
From: Luis Majano <lmaj...@gmail.com>
Date: Wed, 17 Jun 2009 14:04:49 -0700
Local: Wed, Jun 17 2009 5:04 pm
Subject: Re: [coldbox:2958] Re: declaring two different security rules with the security interceptor..

Also, note that your user validator object can do what YOU need it to do. It
is an entry point for the security.  What you do with it, is up to you, so
you can really get creative.

Also, remember that the security rules are basic fields, you can extend
those and add more fields to the rules.  You are not restricted.

Luis

On Wed, Jun 17, 2009 at 1:20 PM, Ernst van der Linden
<evdlin...@gmail.com>wrote:

--
Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldboxframework.com
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ernst van der Linden  
View profile  
 More options Jun 17, 5:28 pm
From: Ernst van der Linden <evdlin...@gmail.com>
Date: Wed, 17 Jun 2009 23:28:13 +0200
Local: Wed, Jun 17 2009 5:28 pm
Subject: Re: [coldbox:2959] Re: declaring two different security rules with the security interceptor..
Remember that the order of the security rules is very important.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
namtax  
View profile  
 More options Jun 19, 10:53 am
From: namtax <nam...@googlemail.com>
Date: Fri, 19 Jun 2009 07:53:55 -0700 (PDT)
Local: Fri, Jun 19 2009 10:53 am
Subject: Re: declaring two different security rules with the security interceptor..
So you have to use one validator and then place variables in there
which determine different security criteria?

Essentially what I have done is set up my application so that some
pages can only be accessed if you signed in, but I also want to be
able to secure some pages, so you can only access them if you arent
logged in..if that makes sense..

I know there must be an easy way of doing this, but cant think at the
moment.

On Jun 17, 10:28 pm, Ernst van der Linden <evdlin...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ernst van der Linden  
View profile  
 More options Jun 19, 12:58 pm
From: Ernst van der Linden <evdlin...@gmail.com>
Date: Fri, 19 Jun 2009 18:58:10 +0200
Local: Fri, Jun 19 2009 12:58 pm
Subject: Re: [coldbox:2961] Re: declaring two different security rules with the security interceptor..
Securityrules is what you need.

Take a look at the security sample application.

You define which pages need login.

Take a look at the regex comments in securityrules.xml.cfm

Ernst


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
namtax  
View profile  
 More options Jun 19, 1:59 pm
From: namtax <nam...@googlemail.com>
Date: Fri, 19 Jun 2009 10:59:40 -0700 (PDT)
Local: Fri, Jun 19 2009 1:59 pm
Subject: Re: declaring two different security rules with the security interceptor..
will have a try and get back to you

Thanks

On Jun 19, 5:58 pm, Ernst van der Linden <evdlin...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
whostheJBoss  
View profile  
 More options Jun 26, 12:01 pm
From: whostheJBoss <dotfus...@changethings.org>
Date: Fri, 26 Jun 2009 09:01:07 -0700 (PDT)
Local: Fri, Jun 26 2009 12:01 pm
Subject: Re: declaring two different security rules with the security interceptor..
You should definitely read the security guide. Here is a quick rundown
if you want to use a custom validator...

If you have a rule such as:

<cfset temp = QuerySetCell(myQuery, "whitelist", "", 1)>
<cfset temp = QuerySetCell(myQuery, "securelist",
"ehGeneral.dspHello", 1)>
<cfset temp = QuerySetCell(myQuery, "roles", "admin", 1)>
<cfset temp = QuerySetCell(myQuery, "permissions", "", 1)>
<cfset temp = QuerySetCell(myQuery, "redirect", "ehGeneral.dspLogin",
1)>

(there are many ways to store the rules, XML, database, etc, I just
happened to create a query here in my getRules() function, check the
cbSecurity guide)

This rule gets matched when any event in the securelist is called. It
passes the query for the matching rule into the validator to be used.

In the validator you would check what your user's settings are (if
they are logged in via a session or cflogin, what their roles are,
etc) and then check them against the roles and permissions list in the
rule query with your own logic. So, you check the user's roles against
the roles in the rule and see if they match up, if so, you allow the
event with return true, if not, you return false and setNextEvent()
will take the user to the event specified in the redirect column of
the rule.

So, if you had two rules:

<cfset temp = QuerySetCell(myQuery, "whitelist", "", 1)>
<cfset temp = QuerySetCell(myQuery, "securelist",
"ehGeneral.dspHello", 1)>
<cfset temp = QuerySetCell(myQuery, "roles", "admin", 1)>
<cfset temp = QuerySetCell(myQuery, "permissions", "", 1)>
<cfset temp = QuerySetCell(myQuery, "redirect", "ehGeneral.dspLogin",
1)>

and

<cfset temp = QuerySetCell(myQuery, "whitelist", "", 2)>
<cfset temp = QuerySetCell(myQuery, "securelist", "ehGeneral.dspHi", 2)


<cfset temp = QuerySetCell(myQuery, "roles", "test", 2)>
<cfset temp = QuerySetCell(myQuery, "permissions", "", 2)>
<cfset temp = QuerySetCell(myQuery, "redirect", "ehGeneral.dspLogin",
2)>

If a user visits ehGeneral.dspHi it will match the second rule and
send that query to the validator, if they visit ehGeneral.dspHello it
sends the first rule to the validator. In the validator, you then
check session.roles or use the built-in cflogin functions to check the
roles and either return true or false if the user is validated.

For example, if you send in the second rule, your user would have to
be in the "test" role to be validated.

You can also use ColdBox's built-in validation based on cflogin, which
is a very simple example provided in the docs.

Let me know if I can help you out with anything else :)

On Jun 19, 7:53 am, namtax <nam...@googlemail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google