5 Replies Latest reply on Oct 1, 2013 12:53 PM by jrenaud

    Extending the admin console tabs from a plugin and defining custom access

    jrenaud

      I was taking a look at how to give a custom access to specific custom tabs, in the admin console, from components defined in a plugin. ( Jive 6.0 Community Administrator Documentation )

       

      I know I can specify an administrative role for which I want a given tab to be displayed, but what if I want to restrain some of these tabs to a specific subset of the users with a minimal access to the administration console? Is it possible to define a custom role or security group for this purpose?

       

      For example, users who can manage a space are granted access the "permission" tab in the admin console: I guess this is a particular case? Or can a similar behavior be attained from the documented framework? (see "UI Components XML Reference" in Jive 6.0 Community Administrator Documentation) I was thinking about the "when" element: Is there an example somewhere about how to test for membership to a particular security group?

       

      Thanks,

      Julien.

        • Re: Extending the admin console tabs from a plugin and defining custom access
          jrenaud

          Hi Ryan Rutan, any lead on a Jiver that could tell if this can be done or not if he saw this?

           

          Basically, I'd want to allow access to a new tab in the admin console for users who can manage a space in our Jive 6 instance, but aren't necessarily part of a system administration role. Any idea if this can be done or not within the existing structure of admin pages?

           

          Thanks,

          Julien.

            • Re: Extending the admin console tabs from a plugin and defining custom access
              cusdenia

              The "Manage Community" role (Users who have space administrators permission) should already already cover this use-case...

               

              You could add an item to the Settings tab (id="community-settings") on the existing Spaces (tab id="communities") in the admin console...

               

              <tab id="communities">

                 <section id="community-settings">

                      <item id="mysettings" name="admin.decorator.menu.spaces.mysettings" url="mysettings.jspa"

                        description="admin.decorator.menu.spaces.mysettings.description" role="Manage System, Manage Community">

                      </item>

                 </section>

              </tab>

               

              Alternately you could add a new section - just add the attribute role="Manage System, Manage Community"

            • Re: Extending the admin console tabs from a plugin and defining custom access
              gdinning

              You can access security groups through the v3 API.  /securityGroups/{securityGroupID}/administrators will return back all the admins and /securityGroups/{securityGroupID}/members will give you all members.  There might be other ways as well (there probably are...), but that's the first thing I found.

               

              The <when> element in plugin.xml can be used to call static methods with the syntax: statics['fully.qualified.ClassName'].myStaticMethod(...).  So, what you can do is write a static method that calls the v3 API to check for entitlements and call it in the when clause to determine if the element should be shown.  Alternately, you can put the logic in the action to the page and access the bean properties on the action from the when clause.  However, if you're not writing/overlaying the action, that might not be an option.  The static method and all the template stuff can be done right in a plugin.