Hy guys!
Im very new to Roo, so maybe i will have some basic questions.
I have a simple problem, i want to protect some views from different Role-s.
for example: a user could only access create photo section, and an admin could list them.
this code doesnt work:
i tried list, list.jspx non of them are working.Code:<intercept-url pattern="/pphotoes/create" access="hasRole('ROLE_USER')" /> <intercept-url pattern="/pphotoes/list" access="hasRole('ROLE_ADMIN')" />
here is the complete applicationContext-security.xml file:
User login is working, and pcustomers views are hidden from User role.Code:?xml version="1.0" encoding="UTF-8"?> <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-3.1.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd"> <!-- HTTP security configurations --> <http auto-config="true" use-expressions="true"> <form-login login-processing-url="/resources/j_spring_security_check" login-page="/login" authentication-failure-url="/login?login_error=t" /> <logout logout-url="/resources/j_spring_security_logout" /> <!-- Configure these elements to secure URIs in your application --> <intercept-url pattern="/pcustomers/**" access="hasRole('ROLE_ADMIN')" /> <intercept-url pattern="/pphotoes/**" access="hasRole('ROLE_ADMIN')" /> <intercept-url pattern="/pphotoes/create" access="hasRole('ROLE_USER')" /> <intercept-url pattern="/porders/create.jspx" access="hasRole('ROLE_USER')" /> <intercept-url pattern="/porders/list.jspx" access="hasRole('ROLE_ADMIN')" /> <intercept-url pattern="/member/**" access="isAuthenticated()" /> <intercept-url pattern="/resources/**" access="permitAll" /> <intercept-url pattern="/login" access="permitAll" /> <intercept-url pattern="/*" access="isAuthenticated()" /> </http> <beans:bean name="AuthenticationController" class="phstore.web.AuthController"> </beans:bean> <!-- Configure Authentication mechanism --> <authentication-manager alias="authenticationManager"> <authentication-provider ref="AuthenticationController" /> </authentication-manager> </beans:beans>
How to manage to hide some views from different roles?


Reply With Quote