5 Replies Latest reply on Jan 12, 2012 10:43 PM by Trong Tran

    Show-Hide portlets based on Group

    Poornima Abhilash Newbie

      Hi all,

       

      Is there any way to show-hide portlets based on 'Groups' in GateIn3.1?We have configured portlets by setting access permision for Group and Role combination.

      Can we do it just based on Groups?

      My requirement is dynamically load portlets based on Group permission.Is there any way to achieve this?

       

      Thanks in advance

        • 1. Re: Show-Hide portlets based on Group
          Trong Tran Master

          Absolutely you could configure Access Permission for portlet to a group with "*" membership type, that means anyone  in the group can access to the portlet.

           

          Is it something that you need ?

          • 2. Re: Show-Hide portlets based on Group
            Tugdual Grall Newbie

            Poornima,

             

            May be I do not understand clearly your question, but you can achieve that in GateIn from the "Edit Permission" tab when you configure the portlet (when you are on edit  mode/page composer on a page).

             

            As you can see in the screenshot that I have attached you can :

            - put the portlet available to any user

            - or select the group with a specific membership, or select (*) to set to "all" people in the group

             

            Screen Shot 2012-01-12 at 10.11.16 AM.png

            • 3. Re: Show-Hide portlets based on Group
              Poornima Abhilash Newbie

              Thanks Trong and Tran.

              Sorry that i didn't mention that we have configured portlets via xml(portal.xml,pages.xml,navigation.xml).Also, seems my question was not clear.

              I want the portlets to be loaded dynamically.During the installtion time only, i may know which all portlets should be shown to the respective customer.

              For Eg : for one customer say A, he need to be shown 3 portlets, but for other, say B, he need to be shown 4 portlets.

              How can i achieve this during installation time?

              Can i switch to a particular xml configuration at one time, and to another acoording to the customer?

              Pls help..

              I will explain it if my friends didn't follow it

               

              Thanks in advance

              • 4. Re: Show-Hide portlets based on Group
                Vu Viet Phuong Novice

                You can configure access permission for each portlets in pages.xml (this file is parsed during installation time). Your page will have 4 portlets, User A only have access permission on 3 portlets --> so when he login to portal, he can only view 3 portlets. Is that what you need ?

                • 5. Re: Show-Hide portlets based on Group
                  Trong Tran Master

                  Hi Poornima,

                   

                  There is a point that you could be able to configure Access Permission to more than one group ( separated by ';' semi-colon ). This would help in your case if i understand well.

                   

                  And the following are examples what you can do. Probably you could adapt it somehow to be suitable for your needs :

                   

                   

                     <portlet-application>
                        <portlet>
                           <application-ref>webapp</application-ref>
                           <portlet-ref>FooPortlet</portlet-ref>
                        </portlet>
                        <access-permissions>Everyone</access-permissions>
                     </portlet-application>
                  
                     <portlet-application>
                        <portlet>
                           <application-ref>webapp</application-ref>
                           <portlet-ref>BarPortlet</portlet-ref>
                        </portlet>
                        <access-permissions>*:/groups/A</access-permissions>
                     </portlet-application>
                  
                     <portlet-application>
                        <portlet>
                           <application-ref>webapp</application-ref>
                           <portlet-ref>ZuuPortlet</portlet-ref>
                        </portlet>
                        <access-permissions>*:/groups/A;*:/groups/B</access-permissions>
                     </portlet-application>