2 Replies Latest reply on Mar 13, 2012 12:09 AM by hemalatha

    How to remove Secret from search filter dropdown in Browse->Places->Social Groups



      We have a requirement where secret group creation, edition and viewing is available only for admin users and non-admin users should not be allowed to either create, edit or view secret groups.


      I have handled the edition and creation part in socialgroup-form.ftl as mentioned in the below thread:

      Re: Remove ability to create a secret group


      Now, we need to remove "Secret" option from search filter dropdown i.e under Browse->Places->Social Groups-> Group Types dropdown only FOR NON-ADMIN users.


      Can anyone please let me know how this can be achieved?


      I tried including a CustomSecretSocialGroupTypeConfig class in which isVisibleToRegisteredUsers() is made to return false.

      But, this appears to have no effect.


      Please help.


      Thanks & Regards,


        • Re: How to remove Secret from search filter dropdown in Browse->Places->Social Groups

          Hi Hema


          Take a look at the SocialGroupBrowseFilterProvider, line 36. That's where the social group types are added to the BrowseFilter, which then passes this information on to be rendered in the SELECT element you mentioned. You could override the SocialGroupBrowseFilterProvider via spring.xml in your plugin, and add a condition there to skip adding the "secret" type if the current user isn't an admin.


          Another way to do it would be to do overlay the soy file (/classes/soy/browse/filter.soy), and add your modifications in the template .compositeFilter, but I wouldn't recommend that, because you'd be overlaying quite a lot of other templates as well.


          Would be nice though if the isVisibleToRegisteredUsers() in SecretSocialGroupTypeConfig would be honored when compiling the items for the select.