Announcement Announcement Module
No announcement yet.
enabling disabling menuitem in menubar Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • enabling disabling menuitem in menubar

    I would like after the login form to be able to "greyed" or to hide some menuitems in the menubar.
    Is there any possiblities to disable or hide menuitems in the menuBar ?

    if you log as an admin, you can access to adminMenu
    if you log as user, you do not.

    Thanks for your help

  • #2
    Spring Rich Client foresees in possibilities to link security credentials to the enabling/disabling of commands or other components (such as binders) for that matter.
    For this, Spring RCP has tight integration with Spring Security. You can configure any command with a security controller, which can then alter the enabled/disabled state of your component. Take a look at SecurityControllable, SecurityController and the other classes in the package.


    • #3
      I'm using spring-security for allowing access to my application with a login Form

      In command-context.xml
      I add
      <bean id="myCreateCommand" class="">
      <property name="securityControllerId" value="adminController"/></bean>
      and I set
      <bean id="adminController" class=" port.UserRoleSecurityController">
      <property name="authorizingRoles" value="ROLE_ADMIN" />
      I succeed to disable menu but if I give to my User the ROLE_ADMIN Role
      The command from the menu is still disabled.My user still not have access

      GrantedAuthority[] arrayAuths = new GrantedAuthority[1];
      arrayAuths[0]= new GrantedAuthorityImpl("ROLE_ADMIN");
      What do I miss ?


      • #4
        find it

        I miss to add

        <bean id="securityAwareConfigurer"
        class=" urityAwareConfigurer"

        Now, it is working, thanks for you jelp


        • #5
          premium quality wigs

          Specializing in lace front wigs, lace wigs premium quality wigs, full lace front wigs and synthetic wigs. Every wig in our luxurious collection is made with best-in-class Remy hair, synthetic hair, cap design, and construction.


          • #6
            something strange

            I have something strange
            In commands-context.xml I have

             <bean id="reportCommand" class="com.MyBeanCommand">
                <property name="securityControllerId" value="adminController"/>
            In security-context.xml, I have
            <bean id="adminController" class="">
                   <property name="authorizingRoles" value="ROLE_ADMIN" />
              <bean id="accessDecisionManager" class="">
                <property name="allowIfAllAbstainDecisions" value="false" />
                <property name="decisionVoters">
                    <ref bean="roleVoter" />
            public class MyBeanCommand extends ApplicationWindowAwareCommand {
                private static final String ID = "myBeanCommand ";
            When I check my user information, I see that I have ROLE_ADMIN in grantedAuthority property
            I do not have access to MyBeanCommand in the menu
            But, if I change my commands-context by
             <bean id="reportCommand" class="com.MyBeanCommand">
                <property name="securityControllerId" value="blabla"/>
            I have access. Can anybody understand what it is wrong ?