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

独自空忆成欢 提交于 2020-01-24 08:51:07

问题


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'.


回答1:


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




回答2:


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



来源:https://stackoverflow.com/questions/9445894/is-it-possible-in-liferay-to-add-custom-resource-actions-to-my-portlet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!