Foros de discusión

Define permissions API for Organization Role not working

thumbnail
Nilesh Gundecha, modificado hace 12 años.

Define permissions API for Organization Role not working

Regular Member Mensajes: 205 Fecha de incorporación: 1/12/09 Mensajes recientes
I am using Liferay 6.1 and I have written below code for defining permissions for custom roles



                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
thumbnail
Nilesh Gundecha, modificado hace 12 años.

RE: Define permissions API for Organization Role not working

Regular Member Mensajes: 205 Fecha de incorporación: 1/12/09 Mensajes recientes
Any help would be highly appreciated!

Regards,
Nilesh
thumbnail
Hitoshi Ozawa, modificado hace 11 años.

RE: Define permissions API for Organization Role not working

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
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.
thumbnail
Surodip Patra, modificado hace 11 años.

RE: Define permissions API for Organization Role not working

Junior Member Mensajes: 29 Fecha de incorporación: 25/01/13 Mensajes recientes
Is there any solution found for this problem? I have the same problem. Can anyone help me please?

Thanks & Regards,
Surodip Patra