Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Nilesh Gundecha
Define permissions API for Organization Role not working
18. April 2012 00:31
Antwort

Nilesh Gundecha

Rang: Regular Member

Nachrichten: 196

Eintrittsdatum: 30. November 2009

Neue Beiträge

I am using Liferay 6.1 and I have written below code for defining permissions for custom roles

 1
 2
 3                Role role = RoleLocalServiceUtil.fetchRole(companyId, RoleType.ORGANIZATION_MANAGER);
 4                int scope = ResourceConstants.SCOPE_GROUP_TEMPLATE;
 5            long roleId = role.getRoleId();
 6        long companyId = role.getCompanyId();
 7        String primKey = String.valueOf(companyId);
 8                String name = "com.liferay.portlet.blogs";
 9                String actionIds[] = new String[] {ActionKeys.ADD_ENTRY, ActionKeys.SUBSCRIBE};
10
11        try{
12            if (_PERMISSIONS_USER_CHECK_ALGORITHM == 6) {
13                ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, name, scope, primKey, roleId, actionIds);
14            }
15            else {
16                PermissionLocalServiceUtil.setRolePermissions(roleId, companyId, name, scope, primKey, actionIds);
17            }
18        }catch(Exception e){
19            e.printStackTrace();
20        }


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
Nilesh Gundecha
RE: Define permissions API for Organization Role not working
19. April 2012 04:03
Antwort

Nilesh Gundecha

Rang: Regular Member

Nachrichten: 196

Eintrittsdatum: 30. November 2009

Neue Beiträge

Any help would be highly appreciated!

Regards,
Nilesh
Hitoshi Ozawa
RE: Define permissions API for Organization Role not working
21. Juli 2012 06:52
Antwort

Hitoshi Ozawa

Rang: Liferay Legend

Nachrichten: 7949

Eintrittsdatum: 23. März 2010

Neue Beiträge

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.
Surodip Patra
RE: Define permissions API for Organization Role not working
30. Januar 2013 02:59
Antwort

Surodip Patra

Rang: Junior Member

Nachrichten: 29

Eintrittsdatum: 25. Januar 2013

Neue Beiträge

Is there any solution found for this problem? I have the same problem. Can anyone help me please?

Thanks & Regards,
Surodip Patra