Mark
Mark

Reputation: 18877

Is it possible in Liferay to add custom Resource-Actions to my portlet?

I create my portlet with Liferay (sdk 6.1), by deploy the portlet gets some default resource-actions, but I need some actions more. Because I want implement some complex permission based portlet. And I don't want create a Ext-Plugin to customize '../resource-actions/default.xml'.

Upvotes: 3

Views: 5835

Answers (2)

Anuj Balan
Anuj Balan

Reputation: 7729

You can set your own user action permissions on the portlet you have created. This code will come to the rescue:

ResourcePermissionLocalServiceUtil.setResourcePermissions(themeDisplay.getCompanyId(),"portlet_name",ResourceConstants.SCOPE_INDIVIDUAL,(String)Iframe_prim_key, new String[]{ActionKeys.VIEW});

Check the same at this link

Upvotes: 0

Martin Gamulin
Martin Gamulin

Reputation: 3865

Did you see this liferay wiki post and this SO question. If you did and those were not helpful please give more details.

Upvotes: 2

Related Questions