Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
Hervé Ménage
Adding portlet permission (LEP 5.1.2)
November 27, 2008 3:22 AM
Answer

Hervé Ménage

Rank: Junior Member

Posts: 50

Join Date: March 1, 2007

Recent Posts

Hi,

Liferay permission and security model is great!
I created a sample portlet on which I want to define a portlet permission (not a model permission).

Here is the XML file, which is successfully read by Liferay at initialization time.

<?xml version="1.0"?>
<resource-action-mapping>

<portlet-resource>
<portlet-name>UserRolePortlet</portlet-name>
<supports>
<action-key>CHECK_ROLE</action-key>
<action-key>CONFIGURATION</action-key>
<action-key>VIEW</action-key>
</supports>

<community-defaults>
<action-key>VIEW</action-key>
</community-defaults>

<guest-defaults>
<action-key>VIEW</action-key>
</guest-defaults>

<guest-unsupported>
<action-key>CHECK_ROLE</action-key>
</guest-unsupported>
</portlet-resource>

</resource-action-mapping>


As explained in the portlet development guide, I should be able to see the "CHECK_ROLE" in the administration interface, in addition to VIEW and CONFIGURATION (see the attached file).

Portlet development guide:

Portlet Permission
On the portlet level, no code needs to be written in order to have the permission system work for your
custom portlet. Your custom portlet will automatically have all the permission features. If you’ve
defined any custom permissions (supported actions) in your portlet-resource tag in section 3.1, those are
automatically added to a list of permissions and users can readily choose them.


I do not understand what is missing...

Thank you for your help

Best regards
Hervé