3 Replies Latest reply on Mar 10, 2011 1:01 AM by snkd

    flex spring security

    FlexSpring

      hi,

      I need to know permision based security framwork called chimp in flex.I am using spring in backend.Any ideas?

        • 1. Re: flex spring security
          snkd Level 1

          ok.

          you can use spring security as your server side security framwork. In spring there are two way security

          1. URL blocking
          2. method level security

           

          As you know Chimp is a permision based security framwork.

          and you can mention the

           

          you can decelare the activities for paticular role as follows

              <!--Meta Data here-->
              <fx:Metadata>
                  [Protected(permissions="admin",inPermissionAction="visible",componentId="btnAdd")]
                  [Protected(permissions="admin",inPermissionAction="visible",componentId="fmAdmin")]
                  [Protected(permissions="user",notInPermissionAction="enable",componentId="btnDelete")]
                  [Protected(permissions="user",notInPermissionAction="removeChild",componentId="btnList")]
                  [Protected(permissions="user",notInPermissionAction="removeFromLayout",componentId="btnFi nd")]
              </fx:Metadata>

           

          you can load chimp security as follows

           

          do this initialy

                      private function create():void {
                          //load the chimp
                           var perms:ArrayCollection = new ArrayCollection();
                          perms.addItem("user");//load role
                          perms.addItem("update");               
                          Chimp.load(perms);               
                      }  

           

          do this when role change add/remove/override

                      private function addPerm(event:Event):void {
                          Chimp.addPerm(cmbRole.selectedItem);
                      }
                     
                      private function removePerm(event:Event):void {
                          Chimp.removePerm(cmbRole.selectedItem);
                      }
                     
                      private function overwritePerms(event:Event):void {
                          var perms:ArrayCollection = new ArrayCollection();
                          perms.addItem(cmbRole.selectedItem);
                          Chimp.updatePerms(perms);
                      }

           

           

          For spring security use the link

          http://www.springbyexample.org/examples/simple-spring-security-webapp-spring-config.html

           

           

          thnx

          1 person found this helpful
          • 2. Re: flex spring security
            snkd Level 1

            ok i missed one thing

             

            [Protected(permissions="admin",inPermissionAction="visible",component Id="btnAdd")]

             

            permissions-admin mean your role

            inPermissionAction- mean if that role has permision the what ?

            notInPermissionAction- mean if that role dont has permision the what ?

            component Id -mean what is the component you gonna restrict,simple give the id as string variable

             

            thnx

            1 person found this helpful
            • 3. Re: flex spring security
              snkd Level 1

              and you cando the following actions in chimp

               

              Possible actions as inPermissionAction/notInPermissionAction:

            • removeChild: Removes the component completely, by calling ‘comp.parent.removeChild()”
            • removeFromLayout: Use the includeInLayout property to remove components
            • invisible: Sets the comp.visible property to false
            • visable: Sets the comp.visible property to true
            • disable: Sets the comp.enable property to false
            • enable: Sets the comp.enable property to true
            • reference from http://code.google.com/p/flexible-chimp/

               

              thnx