掲示板

Define permissions API for Organization Role not working

thumbnail
11年前 に Nilesh Gundecha によって更新されました。

Define permissions API for Organization Role not working

Regular Member 投稿: 205 参加年月日: 09/12/01 最新の投稿
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
11年前 に Nilesh Gundecha によって更新されました。

RE: Define permissions API for Organization Role not working

Regular Member 投稿: 205 参加年月日: 09/12/01 最新の投稿
Any help would be highly appreciated!

Regards,
Nilesh
thumbnail
11年前 に Hitoshi Ozawa によって更新されました。

RE: Define permissions API for Organization Role not working

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
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
11年前 に Surodip Patra によって更新されました。

RE: Define permissions API for Organization Role not working

Junior Member 投稿: 29 参加年月日: 13/01/25 最新の投稿
Is there any solution found for this problem? I have the same problem. Can anyone help me please?

Thanks & Regards,
Surodip Patra