List of usage examples for com.liferay.portal.kernel.service ResourcePermissionServiceUtil setIndividualResourcePermissions
public static void setIndividualResourcePermissions(long groupId, long companyId, String name, String primKey, long roleId, String[] actionIds) throws com.liferay.portal.kernel.exception.PortalException
From source file:com.liferay.exportimport.test.LayoutSetPrototypePropagationTest.java
License:Open Source License
@Ignore @Test// w ww .j ava 2 s. co m public void testLayoutPermissionPropagationWithLinkEnabled() throws Exception { setLinkEnabled(true); Role role = RoleLocalServiceUtil.getRole(TestPropsValues.getCompanyId(), RoleConstants.POWER_USER); ResourcePermissionServiceUtil.setIndividualResourcePermissions(prototypeLayout.getGroupId(), prototypeLayout.getCompanyId(), Layout.class.getName(), String.valueOf(prototypeLayout.getPrimaryKey()), role.getRoleId(), new String[] { ActionKeys.CUSTOMIZE }); prototypeLayout = updateModifiedDate(prototypeLayout, new Date(System.currentTimeMillis() + Time.MINUTE)); CacheUtil.clearCache(prototypeLayout.getCompanyId()); propagateChanges(group); Assert.assertTrue(ResourcePermissionLocalServiceUtil.hasResourcePermission(layout.getCompanyId(), Layout.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, String.valueOf(layout.getPrimaryKey()), role.getRoleId(), ActionKeys.CUSTOMIZE)); }