<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Define permissions API for Organization Role not working</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=13522497" />
  <subtitle>Define permissions API for Organization Role not working</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=13522497</id>
  <updated>2026-06-12T19:45:44Z</updated>
  <dc:date>2026-06-12T19:45:44Z</dc:date>
  <entry>
    <title>RE: Define permissions API for Organization Role not working</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=21064159" />
    <author>
      <name>Surodip Patra</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=21064159</id>
    <updated>2013-01-30T10:59:06Z</updated>
    <published>2013-01-30T10:59:06Z</published>
    <summary type="html">Is there any solution found for this problem? I have the same problem. Can anyone help me please?&lt;br /&gt;&lt;br /&gt;Thanks &amp;amp; Regards,&lt;br /&gt;Surodip Patra</summary>
    <dc:creator>Surodip Patra</dc:creator>
    <dc:date>2013-01-30T10:59:06Z</dc:date>
  </entry>
  <entry>
    <title>RE: Define permissions API for Organization Role not working</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=14965195" />
    <author>
      <name>Hitoshi Ozawa</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=14965195</id>
    <updated>2012-07-21T13:52:39Z</updated>
    <published>2012-07-21T13:52:39Z</published>
    <summary type="html">I think you&amp;#39;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.</summary>
    <dc:creator>Hitoshi Ozawa</dc:creator>
    <dc:date>2012-07-21T13:52:39Z</dc:date>
  </entry>
  <entry>
    <title>RE: Define permissions API for Organization Role not working</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=13547460" />
    <author>
      <name>Nilesh Gundecha</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=13547460</id>
    <updated>2012-04-19T11:03:27Z</updated>
    <published>2012-04-19T11:03:27Z</published>
    <summary type="html">Any help would be highly appreciated!&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Nilesh</summary>
    <dc:creator>Nilesh Gundecha</dc:creator>
    <dc:date>2012-04-19T11:03:27Z</dc:date>
  </entry>
  <entry>
    <title>Define permissions API for Organization Role not working</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=13522496" />
    <author>
      <name>Nilesh Gundecha</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=13522496</id>
    <updated>2012-04-18T07:31:10Z</updated>
    <published>2012-04-18T07:31:10Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;I am using Liferay 6.1 and I have written below code for defining permissions for custom roles&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;

                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();
		}
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;This code does not throw any exception and when I navigate to Control Panel ==&amp;gt; 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.&lt;br&gt;&lt;br&gt;What am I doing wrong here? Any help please?&lt;br&gt;&lt;br&gt;Regards,&lt;br&gt;Nilesh&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Nilesh Gundecha</dc:creator>
    <dc:date>2012-04-18T07:31:10Z</dc:date>
  </entry>
</feed>
