Securing applications

In this recipe, we will talk about applications as a set of portlets and gadgets, and we will see how to secure them.

Getting ready

We need the Application Registry Portlet to start. See the previous recipe to find out how to use it.

How to do it…

As for the categories, the permissions of the applications can be managed through Application Registry. They can be configured graphically, as for the categories, and through XML. Here is the configuration of the Account Portlet:

<object type="org.exoplatform.application.registry.Application">
  <field name="applicationName">
    <string>AccountPortlet</string>
  </field>
……..
  <field name="accessPermissions">
    <collection type="java.util.ArrayList" item-type="java.lang.String">
      <value>
        <string>*:/platform/administrators</string>
      </value>
      <value>
        <string>*:/organization/management/executive-board</string>
      </value>
    </collection>
  </field>
………
</object>

As the application is not used only for administration, we can set the access for the instance. For example, we could get more applications of the same type in a portal. Doing this through the web console is very simple.

  1. Select a page and click on Edit Page:
    How to do it…
  2. Select the body of the application. A tool row will appear at the top-left corner, as shown in the following screenshot:
    How to do it…
  3. Click on the pencil icon to edit the application and go to the permission panel. In this panel, we can set the required permissions, as we did in the Managing registered portlets recipe in Chapter 2, Managing Portal Contents Using the GUI.

Note

The Application Registry seen before automatically injects the default permissions. Here we can change the permissions for this page. For example, we can get a public page with two applications, one visible only by one group and another by another group depending upon the login.

How it works…

As for the categories, the pages are imported from eXo JCR through Chromattic. All permissions are content metadata in GateIn. We can access Chromattic anywhere (groovy scripts, portlets, POJO) and get the information that we need if we have the correct permissions.

As for the categories, there is no difference between the Edit and Access permissions. The access permissions are read by pages and toolboxes. If a toolbox cannot access an application, it means that the toolbox has no edit permission for that application.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.194.230