Created
May 28, 2013 09:34
-
-
Save kimakunc/5661615 to your computer and use it in GitHub Desktop.
Set "view" and "update" permissions on Expando Column for the "Guest" role using Liferay API.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void setExpandoPermissions(long companyId, ExpandoColumn column) { | |
try { | |
Role guestUserRole = RoleLocalServiceUtil.getRole(companyId, RoleConstants.GUEST); | |
if (guestUserRole != null) { | |
// define actions | |
String[] actionIds = new String[] { ActionKeys.VIEW, ActionKeys.UPDATE }; | |
// set the permission | |
ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, | |
ExpandoColumn.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, | |
String.valueOf(column.getColumnId()), guestUserRole.getRoleId(), actionIds); | |
} | |
} catch (PortalException pe) { | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment