Liferay is a Gartner Magic Quadrant Leader for the Sixth Year! Find out why

Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Tom Mahy
Permissions API on layout Page
November 29, 2011 3:29 AM
Answer

Tom Mahy

Rank: Regular Member

Posts: 103

Join Date: May 11, 2011

Recent Posts

This should be easy for anyone thats already done this.

How can i read the permissions on a Layout Page.
I want to know what roles are assigned to this page and what rights they have.

ive tried :

returns empty
1ResourcePermissionLocalServiceUtil.getResourcePermissions(
2                        layout.getCompanyId(), Layout.class.getName(),
3                        ResourceConstants.SCOPE_INDIVIDUAL, String.valueOf(layout.getPrimaryKey()));


cant seem to get roles from the permission list
1List<Permission> permissions = PermissionLocalServiceUtil.getGroupPermissions(layout.getGroupId(),
2                        layout.getCompanyId(),
3                        Layout.class.getName(),
4                        ResourceConstants.SCOPE_COMPANY,
5                        String.valueOf(layout.getPrimaryKey()));


empty
1PermissionLocalServiceUtil.getRolePermissions(roleId, resourceId)


Any help would be appreciated.
Tom Mahy
RE: Permissions API on layout Page
November 29, 2011 8:15 AM
Answer

Tom Mahy

Rank: Regular Member

Posts: 103

Join Date: May 11, 2011

Recent Posts

Searched the whole day. Could not find it.
So im writing my own API.
Surodip Patra
RE: Permissions API on layout Page
February 3, 2013 10:27 PM
Answer

Surodip Patra

Rank: Junior Member

Posts: 29

Join Date: January 25, 2013

Recent Posts

Hi Tom,
Can you get this done? If yes can you help me to set Role Permissions for a Portlet in Liferay?

Thanks & Regards,
Surodip Patra