Planned maintenance is scheduled for the week of June 15th - the exact date and time will be announced soon.
See More Details
Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Define permissions API for Organization Role not working
I am using Liferay 6.1 and I have written below code for defining permissions for custom roles
This code does not throw any exception and when I navigate to Control Panel ==> Role Admin section, it shows that check box selected for the required permissions. But in actual, the permissions are not assigned. When I click on SAVE from Control Panel, then the permissions are getting assigned and it reflects in the portlets.
What am I doing wrong here? Any help please?
Regards,
Nilesh
Role role = RoleLocalServiceUtil.fetchRole(companyId, RoleType.ORGANIZATION_MANAGER);
int scope = ResourceConstants.SCOPE_GROUP_TEMPLATE;
long roleId = role.getRoleId();
long companyId = role.getCompanyId();
String primKey = String.valueOf(companyId);
String name = "com.liferay.portlet.blogs";
String actionIds[] = new String[] {ActionKeys.ADD_ENTRY, ActionKeys.SUBSCRIBE};
try{
if (_PERMISSIONS_USER_CHECK_ALGORITHM == 6) {
ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, name, scope, primKey, roleId, actionIds);
}
else {
PermissionLocalServiceUtil.setRolePermissions(roleId, companyId, name, scope, primKey, actionIds);
}
}catch(Exception e){
e.printStackTrace();
}
This code does not throw any exception and when I navigate to Control Panel ==> Role Admin section, it shows that check box selected for the required permissions. But in actual, the permissions are not assigned. When I click on SAVE from Control Panel, then the permissions are getting assigned and it reflects in the portlets.
What am I doing wrong here? Any help please?
Regards,
Nilesh
Any help would be highly appreciated!
Regards,
Nilesh
Regards,
Nilesh
I think you'll get better replies if you post your question to the 3. Development forum instead of this forum which is about liferay.com site here.
Is there any solution found for this problem? I have the same problem. Can anyone help me please?
Thanks & Regards,
Surodip Patra
Thanks & Regards,
Surodip Patra
Community
Company
Feedback