Fórum
Permissions for Embedded Portlet
Michael Voss, modificado 7 Anos atrás.
Permissions for Embedded Portlet
New Member Postagens: 17 Data de Entrada: 08/12/16 Postagens Recentes
Hi All,
this is my first post, but i have read a lot in this forum already.
My Problem is:
I have an embedded Portlet in my portal_normal.vm. I need to check, if a user (or guest) has the permission, to see that portlet.
I tried testing with permissionChekcer in portal_normal.vm:
#set ($viewCart=$permissionChecker.hasPermission($themeDisplay.getSiteGroupId(),"embeddedPortlet_WAR_INSTANCE_E3j7",$themeDisplay.getPortletDisplay().getResourcePK(), "1"))
#if($viewCart)
...(Code to show embeddedPortlet)
#end
The "1" at the end stands for "ActionKeys.VIEW", i had some trouble with the Action Keys, so for the beginning, I decided to use the integer value directly.
It is not working, the siteGroupId is read correctly, but the resourcePK is always returned null, and thus $viewCart is always false.
I was searching the internet (and this forum) quite a lot, but found nothing really applying to my Problem.
Hope you can give me some hints.
this is my first post, but i have read a lot in this forum already.
My Problem is:
I have an embedded Portlet in my portal_normal.vm. I need to check, if a user (or guest) has the permission, to see that portlet.
I tried testing with permissionChekcer in portal_normal.vm:
#set ($viewCart=$permissionChecker.hasPermission($themeDisplay.getSiteGroupId(),"embeddedPortlet_WAR_INSTANCE_E3j7",$themeDisplay.getPortletDisplay().getResourcePK(), "1"))
#if($viewCart)
...(Code to show embeddedPortlet)
#end
The "1" at the end stands for "ActionKeys.VIEW", i had some trouble with the Action Keys, so for the beginning, I decided to use the integer value directly.
It is not working, the siteGroupId is read correctly, but the resourcePK is always returned null, and thus $viewCart is always false.
I was searching the internet (and this forum) quite a lot, but found nothing really applying to my Problem.
Hope you can give me some hints.
Michael Voss, modificado 7 Anos atrás.
RE: Permissions for Embedded Portlet
New Member Postagens: 17 Data de Entrada: 08/12/16 Postagens Recentes
I couldn't find a solution to my Problem. Now i started trying it not inside portal_normal.vm, but inside the backing bean.
I wanted to check the permission for the portlet whenever it was called. But that doesn't work either.
I am not sure what the problem is, but i seems that it is just not possible to check permissions for embedded Portlets. When i check the permission for the Portlet Instance (poertletName_WAR_packageName_INSTANCE_ID) it always returns false.
I wanted to check the permission for the portlet whenever it was called. But that doesn't work either.
I am not sure what the problem is, but i seems that it is just not possible to check permissions for embedded Portlets. When i check the permission for the Portlet Instance (poertletName_WAR_packageName_INSTANCE_ID) it always returns false.