سؤال

I was using waffle and spring security 3.2 to set access to jsf2 pages. I used this example

Everything works fine, but I am curious, if posible to set access to page via xml file for one user??? Something like that:

 <sec:intercept-url pattern="/**" access="PRINCIPAL='tom'" />

I couldn't find answer in internet

Thanks

هل كانت مفيدة؟

المحلول

Yes it is possible if you use SpEL expressions:

<sec:http use-expressions="true">
    ....
    <sec:intercept-url pattern="/**" access="principal.name=='tom'" />
    ....
</sec:http>

نصائح أخرى

Using @Maksym answer I found my solution (I think in some cases both can be right) :

<sec:http use-expressions="true">
    ....
    <sec:intercept-url pattern="/**" access="authentication.name=='tom'" />
    ....
</sec:http>
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top