How to define an objectDefinitionSource in the class FilterSecurityInterceptor
Hello,
I worked with Acegi a long time ago, and now that I start to work again with it, I would like to know what are the possible ways to define the property quot;objectDefinitionSourcequot; in the class FilterSecurityInterceptor?
At the moment I define it in the acegiApplicationContext.xml like this :
lt;bean id=quot;filterSecurityInterceptorquot; class=quot;org.acegisecurity.intercept.web.FilterSecur ityInterceptorquot;gt;
lt;property name=quot;authenticationManagerquot; ref=quot;authenticationManagerquot; /gt;
lt;property name=quot;accessDecisionManagerquot; ref=quot;accessDecisionManagerquot; /gt;
lt;property name=quot;objectDefinitionSourcequot;gt;
lt;valuegt;CONVERT_ucl_TO_LOWERCASE_BEFORE_COMPARISON
\A/home.jsp*\Z=ROLE_TEST
\A/cmscontroller\?action\=loadfile\amp;amp;param\=*\Z=RO LE_ADMIN
lt;/valuegt;
lt;/propertygt;
lt;/beangt;
Is there any other way? Thanks in advance!!!
Try something similar to thisCode:
lt;beans:bean id=quot;filterSecurityInterceptorquot; class=quot;org..security.intercept.web.FilterSecurityInterceptorquot;gt;
lt;beans:property name=quot;authenticationManagerquot; ref=quot;authenticationManagerquot;/gt;
lt;beans:property name=quot;accessDecisionManagerquot; ref=quot;accessDecisionManagerquot;/gt;
lt;beans:property name=quot;objectDefinitionSourcequot;gt;
lt;filter-invocation-definition-sourcegt;
lt;intercept-ucl pattern=quot;/login.jspquot; access=quot;ROLE_ANONYMOUSquot;/gt;
lt;intercept-ucl pattern=quot;/secure/*.htm*quot; access=quot;ROLE_USERquot;/gt;
lt;intercept-ucl pattern=quot;/secure/managersecure/*.htm*quot; access=quot;ROLE_MANAGER/gt;
lt;intercept-ucl pattern=quot;/*.htm*quot; access=quot;ROLE_USERquot;/gt;
lt;intercept-ucl pattern=quot;/**quot; access=quot;IS_AUTHENTICATED_ANONYMOUSLYquot;/gt;
lt;/filter-invocation-definition-sourcegt;
lt;/beans:propertygt;
lt;/beans:beangt;First of all, thanks for the answer. But I thin I did not explain well, I meant if there is other way to define this, without a, injected Map, I mean by data base, or reading from a file. Something that after these allow me to add new entries dinamically?
Thanks again!! |