|
|
help in Spring security (Roo 1.0.2)
Hi !!!
I'm new in Roo ( and every Spring universe ).
In my project i need that the quot;ADMINquot; can use quot;Createquot; and quot;listquot;, and the quot;USERquot; just quot;listquot;.
I can't use just hide, because quot;USERquot; can access quot;Createquot; using the Create ucl.
I use quot;lt;sec:authorize access=quot;hasRole('ROLE_ADMIN')quot;gt;quot; in menu.jpsx but this just hide the link to Create, if i use the ucl i can access the Create anybody can help me ?
my ApplicationContext-security.xml Code:
lt;?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?gt;
lt;beans:beans xmlns=quot;schema/securityquot;
xmlns:beans=quot;schema/beansquot; xmlns:xsi=quot;2001/XMLSchema-instancequot;
xsi:schemaLocation=quot;schema/beans schem...-beans-3.0.xsd schema/security schema/security/spring-security-3.0.xsdquot;gt;
lt;!-- from security configurations --gt;
lt;from auto-config=quot;truequot; use-expressions=quot;truequot;
access-denied-page=quot;/app/accessDeniedquot;gt;
lt;form-login login-processing-ucl=quot;/static/j_spring_security_checkquot;
login-page=quot;/loginquot; authentication-failure-ucl=quot;/login?login_error=tquot; /gt;
lt;logout logout-ucl=quot;/static/j_spring_security_logoutquot; /gt;
lt;!-- Configure these elements to secure URIs in your application --gt;
lt;intercept-ucl pattern=quot;/album/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/alias**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/artist/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/brand/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/carrier/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/category/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/device/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/deviceconfig/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/frontend/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/frontendgroup/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/frontendinfo/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/genre/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/internaluser/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/manufacturer/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/media/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/mediadata/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/mediainputformat/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/mediainputinstance/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/mediametadata/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/mediaoutputformat/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/mediaoutputinstance/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/mediastatistics/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/mediatype/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/ordertype/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/owner/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/price/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/pricegroup/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/pricerule/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/pricetag/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/region/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/subscriptionoffer/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/subscriptionservice/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/tac/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/theme/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/useragent/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/vipuser/**quot; access=quot;hasRole('ROLE_ADMIN')quot; /gt;
lt;intercept-ucl pattern=quot;/**quot; access=quot;permitAllquot; /gt;
lt;/fromgt;
lt;!-- Configure Authentication mechanism--gt;
lt;authentication-manager alias=quot;authenticationManagerquot;gt;
lt;!--
SHA-256 values can be produced using 'echo -n your_desired_password |
sha256sum' (using normal *nix environments)
--gt;
lt;authentication-providergt;
lt;password-encoder hash=quot;sha-256quot; /gt;
lt;jdbc-user-service data-source-ref=quot;dataSourcequot;
authorities-by-username-query=quot;select username,authority from users where username=?quot; /gt;
lt;/authentication-providergt;
lt;/authentication-managergt;
lt;/beans:beansgt;
Sorry my english ^^ i can't talk very well eheheheh
Problem resolved !!!!!
every passing day I love more Spring Roo!!
mauehauheauhe |
|