Removing Custom Permissions/Actions from a Portlet

て烟熏妆下的殇ゞ 提交于 2019-12-03 08:44:31

Permissions are not removed from database for the portlet either when you un-deploy the portlet, or when you restart the server. why?

Because, undeploying a portlet does not necessarily mean the data needs to be removed from the database, the portlet can be redeployed many times. So liferay correctly takes the safe route of keeping the data intact unless it is manually deleted through the database or through some service. And the permissions are considered as data just like you have data stored for your custom asset.

So you can delete the permissions from ResourceAction table by creating some service or through the beanshell scripting panel in control PanelServer AdministrationScriptingSelect Beanshell. You would also need to take care of the bitwiseValue and the permissions already set in the ResourcePermission table.

I would suggest renaming the permission in the ResourceAction table rather than deleting and adding new, it might get complicated.

Hope this helps.

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