4 Replies Latest reply on May 23, 2013 4:18 AM by devPl83

    Custom user/group properties

    devPl83

      Hi,

       

      Is there a possibility to extend the standard user/group properties (CQ5 Security)? I would like to add some more properties then the standard name, mail, about,....

      I've tried to extend the dialog by cutomizing the UserProperties.js Dialog. The Problem is that cq5 doesent save the newly added propertes. There is a save function using the folowing service.

       

                      url = CQ.HTTP.externalize("/bin/security/authorizables/POST");

                      url = CQ.HTTP.addParameter(url, "Authorizable", frm.findField("id").getValue());

       

      It posts the parameter but it doesent get saved.

      Is there a way to make it work?

        • 1. Re: Custom user/group properties
          Sham HC Level 7

          Hi devP,

           

             I never tried it but Profile properties should work. Which property & what location you are trying to save?

           

          Thanks,

          Sham

          • 2. Re: Custom user/group properties
            devPl83 Level 1

            Hi Sham,

             

            I would just like to save some new, custom, properties (let say "City" or a path to a certain node in the Websites tree) for a user or a group. It would be the best I could do that sanding a /bin/security/authorizables/POST reuest. Though it seems immposible cause this service seems to accept only the already defined properties. Is there a way to extend this service and make it accept my custom properties?

             

            Regards,

            Piotr

            • 3. Re: Custom user/group properties
              sparktronics

              I have the same problem. Let me know how did you solve it.

               

              Thanks

              • 4. Re: Custom user/group properties
                devPl83 Level 1

                I have used a kind of a workaround. Just created a new tab for the user/group properties and registered it in the UserAdmin.js . The Tab is implemented similar to the CQ.security.UserProperties and has a similar save handler.

                 

                I'm getting the stored Properties the following way:

                 

                        private static final String PREFERENCES_NODE_PATH = "/preferences";

                 

                        preferencesNode = currentSession.getNode(group.getPath() + PREFERENCES_NODE_PATH);

                        if (preferencesNode.hasProperty(preferenceName)) {

                            preferenceValue = preferencesNode.getProperty(preferenceName);

                        }

                I know it's not the most elegant solution but the fastest I have found.