Foren

Problem with adding resource permission

thumbnail
Richard Lam, geändert vor 12 Jahren.

Problem with adding resource permission

New Member Beitrag: 1 Beitrittsdatum: 16.09.10 Neueste Beiträge
Hi,

I'm trying to add permission at the individual level to a bookmark so I am using the following API.

ResourcePermissionServiceHttp.addResourcePermission(principal, groupId, companyId, name, ResourceConstants.SCOPE_INDIVIDUAL, primaryKey, roleId, view);

When I use the control panel to add permissions to bookmark, I noticed the scope is 4. Hence I tried to use the same scope.

However the api is giving me an com.liferay.portal.NoSuchResourcePermissionException.

I tracked down the code to the following line in ResourcePermissionLocalServiceImpl (line 70)

else if (scope == ResourceConstants.SCOPE_INDIVIDUAL) {
throw new NoSuchResourcePermissionException();
}

How can I add permission to a bookmark at scope level SCOPE_INDIVIDUAL if this api doesn't work?
Jonas MzH, geändert vor 12 Jahren.

RE: Problem with adding resource permission

New Member Beiträge: 19 Beitrittsdatum: 05.11.09 Neueste Beiträge
Hey,
like I got the same problem I would recommend you to use "setResourcePermission" instead of "add...".

It's not as clear as it should be :-(

Hope this helps