留言板

liferay 6 programmatically add permission

thumbnail
Rahul Bhattacharya,修改在12 年前。

liferay 6 programmatically add permission

Junior Member 帖子: 58 加入日期: 10-1-16 最近的帖子
hi,
i am facing a problem with LR 6 permissioning.

I have a requirement to programmatically add permissions for a resource.

i am setting the permissions like this
ResourcePermissionLocalServiceUtil.setResourcePermissions(org.getCompanyId(),
Lineage.class.getName(), ResourceConstants.SCOPE_COMPANY, baseLineage.getLineageValue(), authorRole.getRoleId(), new String[]{ActionKeys.VIEW});


In the remote service i am doing this
if( getPermissionChecker().hasPermission(groupId, Lineage.class.getName() , baseLineage.getLineageValue(), ActionKeys.VIEW))
{
............
}

But some how this never comes as true.

Any help is appreciated

thanks
Rahul