Message Boards

[LF7.1GA2] Permission missing from portlet

Diego Cantone, modified 5 Years ago.

[LF7.1GA2] Permission missing from portlet

Junior Member Posts: 42 Join Date: 11/10/16 Recent Posts
Hello, i followed this tutorial to define Portlet Permission, but the portlet doesn't want to show the permission i defined in the xml file, the strange thing is that in another module everything works fine, but i followed exactly the same step, i created the xml file inside resource-action folder, i defined the permission with the following scheme
<!--?xml version="1.0"?-->


<resource-action-mapping>

&nbsp;&nbsp; &nbsp;<portlet-resource>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<portlet-name>it_ext_mk_liferay_portlet_scorm_portlet_CorsiScormPortlet</portlet-name>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<permissions>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<supports>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>CONFIGURATION</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>PREFERENCES</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>VIEW</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>COORDINAMENTO_CORSI</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;</supports>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<site-member-defaults>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>VIEW</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;</site-member-defaults>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<guest-defaults></guest-defaults>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<guest-unsupported>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>CONFIGURATION</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>PREFERENCES</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>VIEW</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>COORDINAMENTO_CORSI</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;</guest-unsupported>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;</permissions>
&nbsp;&nbsp; &nbsp;</portlet-resource>

</resource-action-mapping>
then i edited the portlet.properties file to insert
##
## Resource Actions
##

&nbsp; &nbsp; #
&nbsp; &nbsp; # Input a list of comma delimited resource action configurations that will
&nbsp; &nbsp; # be read from the class path.
&nbsp; &nbsp; #&nbsp;&nbsp; &nbsp;
&nbsp;&nbsp; &nbsp;resource.actions.configs=META-INF/resource-actions/corsiscorm.xml
anyone have an idea of why it doen't work?
I already tried to restart the server, clean temp folder, redeploy many times the module..
thumbnail
David H Nebinger, modified 5 Years ago.

RE: [LF7.1GA2] Permission missing from portlet

Liferay Legend Posts: 14917 Join Date: 9/2/06 Recent Posts
I've seen cases where redeployment doesn't change existing permissions defined for a portlet.

I would suggest two things:

1. verify that the portlet id is it_ext_mk_liferay_portlet_scorm_portlet_CorsiScormPortlet because, if it is different, the permissions don't apply to it.

2. Purge osgi/state as well as the portlet's record from the Release_ table so Liferay sees it as a new deployment, not an update.

IIRC there's a blurb in the linked doco indicating that the perms will apply only during first time deployment; I think redeploys and updates need to do their permission adds separately via an upgrade process.
​​​​​​​
Diego Cantone, modified 5 Years ago.

RE: [LF7.1GA2] Permission missing from portlet

Junior Member Posts: 42 Join Date: 11/10/16 Recent Posts
Hi David, thanks for answer, i checked the portlet name many times, now i also tried to delete osgi/state folder, but without success..
I also take a look to the Release table, and i noticed that there isn't any portlet module record, but only the service-module record..
Also permission configurations work fine on the service module, i've just tried to change the xml file and after a redeploy i can see new permission in the control panel..
Edit: I just tried to put
​​​​​​​<portlet-resource>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<portlet-name>it_ext_mk_liferay_portlet_scorm_portlet_CorsiScormPortlet</portlet-name>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<permissions>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<supports>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>CONFIGURATION</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>PREFERENCES</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>VIEW</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>COORDINAMENTO-CORSI</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;</supports>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<site-member-defaults>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>VIEW</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;</site-member-defaults>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<guest-defaults></guest-defaults>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<guest-unsupported>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>CONFIGURATION</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>PREFERENCES</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>VIEW</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>COORDINAMENTO-CORSI</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;</guest-unsupported>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;</permissions>
&nbsp;&nbsp; &nbsp;</portlet-resource>
Inside the xml file in the service module, and it works, any idea of why the portlet module doesn't want to update its permission scheme?