Re: [Acegisecurity-developer] Dinamic objectDefinitionSource

2006-09-28 Thread Baba . Buehler

I needed to implement a very similar
dynamic system for the URL-to-Role mapping.

My solution was to write an extension
of AbstractFilterInvocationDefinitionSource that accessed the backend data
that the mappings came from and implements lookupAttributes(url) to return
a ConfigAttributeDefinition with the proper required role.  Then you
can just pass that class into the regular ACEGI classes that want an objectDefinitionSource.

Since you get the url as a pramater,
you're pretty much free to implement the mapping in any way you see fit.


-baba

--
Baba Buehler - [EMAIL PROTECTED] - Austin, Texas

[EMAIL PROTECTED]
wrote on 09/27/2006 04:25:38 PM:

> 
> Hi,
>   
>  First of all,I`m from spain so my english is not good. Let`s
talk 
> about my problem.
> 
>  I´m a newbie using acegi and I want to build an application
with 
> diferent profiles but I don´t want to asociate them to each page (or
> by using regular expresions) such as:
> 
>       
>          
>             CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
>             PATTERN_TYPE_APACHE_ANT

>             /jsp/*=ROLE_USER,ROLE_ADMIN
>             /secure/*=ROLE_ADMIN
>             /index.jsp=ROLE_USER,ROLE_ADMIN
>          
>       
> 
> Is there any way to build dinamicaly the asociantions between url

> pattern and ROLE (or profile) ?
> 
> Could I save in a DataBase these associations(URL pattern-
> Profile(ROLE))? could acegi could ask for them?
> 
> Thanks!
> 
> Arturo San Feliciano Martín
> 
>  
> 
> -
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to
share your
> opinions on IT & business topics through brief surveys -- and
earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> ___
> Home: http://acegisecurity.org
> Acegisecurity-developer mailing list
> Acegisecurity-developer@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/acegisecurity-developer
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Home: http://acegisecurity.org
Acegisecurity-developer mailing list
Acegisecurity-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/acegisecurity-developer


Re: [Acegisecurity-developer] Dinamic objectDefinitionSource

2006-09-27 Thread Ben Alex
Arturo San Feliciano Martín wrote:
> 
> Is there any way to build dinamicaly the asociantions between url pattern and 
> ROLE (or profile) ?
> 
> Could I save in a DataBase these associations(URL pattern-Profile(ROLE))? 
> could acegi could ask for them?

Hi Arturo

You can write a custom FilterInvocationDefinitionSource and obtain the
information from anywhere. I'm aware of at least one content management
system that pulls the metadata from a database. Once you've written a
database FilterInvocationDefinitionSource, simply use  element inside your
FilterSecurityInteceptor bean definition.

Cheers
Ben

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Home: http://acegisecurity.org
Acegisecurity-developer mailing list
Acegisecurity-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/acegisecurity-developer


[Acegisecurity-developer] Dinamic objectDefinitionSource

2006-09-27 Thread Arturo San Feliciano Martín

Hi,
  
 First of all,I`m from spain so my english is not good. Let`s talk about my 
problem.

 I´m a newbie using acegi and I want to build an application with diferent 
profiles but I don´t want to asociate them to each page (or by using regular 
expresions) such as:



CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
PATTERN_TYPE_APACHE_ANT 
/jsp/*=ROLE_USER,ROLE_ADMIN
/secure/*=ROLE_ADMIN
/index.jsp=ROLE_USER,ROLE_ADMIN



Is there any way to build dinamicaly the asociantions between url pattern and 
ROLE (or profile) ?

Could I save in a DataBase these associations(URL pattern-Profile(ROLE))? could 
acegi could ask for them?

Thanks!

Arturo San Feliciano Martín

 

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Home: http://acegisecurity.org
Acegisecurity-developer mailing list
Acegisecurity-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/acegisecurity-developer