Results 1 to 3 of 3

Thread: problems with authorization

  1. #1
    Join Date
    Oct 2005
    Posts
    26

    Unhappy problems with authorization

    I have 2 Problems:

    1-I want that only the ROLE_USER has access to the page having the address pwdChange.do so, I have declared it in the objectDefinitionSource but it did not work :-(

    2-I want that either the ROLE_USER or ROLE_ADMIN has access to a number of page. I have declared this in the objectDefinitionSource, but when a user try to login in to my application it should have the two role (ROLE_USER and ROLE_ADMIN) or it can't !?

    ----------my application Infos
    I'm using struts as MVC framework

    ----in my application-context ----
    <bean id="memoryAuthenticationDao"
    class="net.sf.acegisecurity.providers.dao.memory.I nMemoryDaoImpl">
    <property name="userMap">
    <value>
    admin=admin,ROLE_ADMIN
    user=user,ROLE_USER
    </value>
    </property>
    </bean>

    <bean id="filterInvocationInterceptor"
    ...
    <property name="objectDefinitionSource">
    <value>
    CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
    PATTERN_TYPE_APACHE_ANT

    /welcome.do=ROLE_ANONYMOUS
    /pwdChange.do=ROLE_USER
    /*.do*=ROLE_USER,ROLE_ADMIN
    /pages/user/**=ROLE_USER
    /pages/admin/**=ROLE_ADMIN
    /pages/**=ROLE_USER,ROLE_ADMIN

    </value>
    </property>
    </bean>

    ----in my struts-config ----
    <action-mappings>

    <action parameter="/pages/admin/rightsAffectation.jsp" path="/rightsAffectation" type="org.apache.struts.actions.ForwardAction"/>
    ...

    <action parameter="/pages/user/pwdChange.jsp" path="/pwdChange" type="org.apache.struts.actions.ForwardAction"/>

    <action parameter="/pages/Welcome.jsp" path="/Welcome" type="org.apache.struts.actions.ForwardAction"/>
    <action parameter="/logout.jsp" path="/logout" type="org.apache.struts.actions.ForwardAction"/>
    <action parameter="/login.jsp" path="/login" type="org.apache.struts.actions.ForwardAction"/>

    </action-mappings>

    ----my web-app structure ----
    MyApp
    +--pages
    +--admin
    -rightsAffectation.jsp
    +--user
    -pwdChange.jsp
    +--web-inf
    -applicationContext
    -struts-config.xml
    -web.xml
    ...
    be happy :-)

  2. #2
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    This is a duplicate of another thread. Please limit discussions to one thread per issue, as it helps people with searching and reading alike.
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

  3. #3
    Join Date
    Oct 2005
    Posts
    26

    Default

    I'm sorry, I haven't done it deliberately :-(
    be happy :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •