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:
>
> <property name="objectDefinitionSource">
> <value>
> CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
> PATTERN_TYPE_APACHE_ANT
> /jsp/*=ROLE_USER,ROLE_ADMIN
> /secure/*=ROLE_ADMIN
> /index.jsp=ROLE_USER,ROLE_ADMIN
> </value>
> </property>
>
> 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
> [email protected]
> 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 [email protected] https://lists.sourceforge.net/lists/listinfo/acegisecurity-developer
