1
votes

I have created a custom Regular Role and I have inserted it inside portlet.xml of so-portlet(security-role-ref element) and I have also mapped it with the respective role in liferay-portlet.xml. However, when a user owns only this custom Regular Role, an error message is displayed "You do not have the roles required to access this portlet". It is also strange that this happens only in user's personal site, on any other site user is able to view the specific portlet.

Does anyone has any idea about this?

2
Can you check the settings / permissions for that specific portlet instance ? These settings are overriding the portal's permissions and the Portlet's default permissionsyannicuLar
I am using the social office theme where the so-portlet is embedded in theme. By default, in sidebar_portlets.vm the portlet preferences are set like this $velocityPortletPreferences.setValue("displayStyle", "0") $velocityPortletPreferences.setValue("portletSetupShowBorders", "false")jkonst
Is it possible to change these portlet permissions(e.g. which roles can view this portlet) programmaticaly?jkonst
hmm that's not what I meant :) I've posted an answer for your. No, you shouldn't edit roles programmatically, you should use the provided interface.yannicuLar

2 Answers

1
votes

Since you have a Custom Regular Role for your App, you should edit the default Role Permissions

  1. log as an admin
  2. Go to Control Panel, Roles,
  3. Find your Role, and from the Actions menu on the right side, pick Define Permissions
  4. From the left menu, find your application
  5. Edit your permissions. Make sure to have the 'View' action granted for your Role. You can additionally, allow it for all sites (default), or you can just select the 'User Personal Site' enter image description here

Now, if you want to make an exception for a specific portlet instance (that's what I meant in my question, in the comments) you can:

  1. Log as Admin
  2. Navigate to the specific Page where your portlet instance is added.
  3. Enable Edit Controls, and edit your portlet (mini menu on the upper right side, with the wrench icon)
  4. Pick permissions and have your Role allowed to view the portlet
0
votes

The Personal Site is a Private Site if I remember well, so i think your user is not a site member, necessary condition to view the private pages.