Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-51807

Permission checker doesn't work when groupId is 0

    Details

    • Fix Priority:
      4

      Description

      My portlet has a service builder entity which is not tied to a groupId, I need to check if users have permission to create instances of this entity. It's like a global permission checking, I need to check if users have permissions to add devices to the portal, regardless of the Site my portlet is deployed to.

      Here's my permission checker code:

      permissionChecker.hasPermission(0, RESOURCE_NAME, 0, actionId);

      Here's the source code:

      https://github.com/liferay/liferay-plugins/blob/master/portlets/push-notifications-portlet/docroot/WEB-INF/service/com/liferay/pushnotifications/service/permission/PushNotificationsPermission.java#L40

      This used to work back in August this year, it was suddenly broken in master. It throws PrincipalException all the time now.

      Tomáš Polešovský was able to figure out which change caused it:

      https://issues.liferay.com/browse/LPS-47464

        Attachments

          Activity

            People

            Assignee:
            tomas.polesovsky Tomáš Polešovský
            Reporter:
            bruno.farache Bruno Farache (Inactive)
            Participants of an Issue:
            Recent user:
            Esther Sanz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              4 years, 40 weeks, 3 days ago

                Packages

                Version Package
                7.0.0 Beta 8