Portal.hasPermission returns false if Permission parameter contains multiple Memberships

Solution Verified - Updated -

Issue

We have 2 sites

http://localhost:8080/portal/customers/
http://localhost:8080/portal/administration/

In a portlet, we need to show a link to the "/portal/administration/" site if the user has access to it.

The access permissions for the "administration" site are defined as set as "*:/platform/administrators/admin_group1;*:/platform/administrators/admin_group2;*:/platform/administrators/admin_group3".

The user is linked with the "/platform/administrators/admin_group1" with MembershipType "member".

In our portlet, we are checking the permissions using the following code:

  PortalRequest portalRequest = PortalRequest.getInstance();
  Site adminSite = portalRequest.getPortal().getSite(new SiteId("administration"));
  portal.hasPermission(portalRequest.getUser() , adminSite.getAccessPermission());

But the hasPermission method is returning false.

Environment

  • Red Hat JBoss Portal
    • 6.1.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.