<?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>Liferay 7.1.2: I can't modify the default permissions for the role User</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=113593963" />
  <subtitle>Liferay 7.1.2: I can't modify the default permissions for the role User</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=113593963</id>
  <updated>2026-04-04T21:35:29Z</updated>
  <dc:date>2026-04-04T21:35:29Z</dc:date>
  <entry>
    <title>RE: Liferay 7.1.2: I can't modify the default permissions for the role User</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113628728" />
    <author>
      <name>Tomáš Polešovský</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113628728</id>
    <updated>2019-05-14T11:50:56Z</updated>
    <published>2019-05-14T11:50:56Z</published>
    <summary type="html">Thanks, now I understand. &lt;br /&gt;&lt;br /&gt;Yes, this was fixed in 7.1.3 CE GA4.</summary>
    <dc:creator>Tomáš Polešovský</dc:creator>
    <dc:date>2019-05-14T11:50:56Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7.1.2: I can't modify the default permissions for the role User</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113627299" />
    <author>
      <name>Santiago Pérez de la Cámara</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113627299</id>
    <updated>2019-05-14T11:03:00Z</updated>
    <published>2019-05-14T11:03:00Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi Tomas:&lt;br&gt;I think the bug is in the class:&amp;nbsp;&lt;br&gt;&lt;br&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace"&gt;com.liferay.portal.service.impl.&lt;strong&gt;ResourcePermissionLocalServiceImpl&lt;/strong&gt;&lt;/span&gt;&lt;br&gt;&lt;br&gt;Method:&lt;br&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace"&gt;&lt;br&gt;&lt;strong&gt;hasScopeResourcePermission&lt;/strong&gt;&lt;/span&gt;&lt;br&gt;&lt;br&gt;The method is looking for a ResourcePermission list without taking into account the roleId. It retrieves several rows from database related with N roles and if one of them has the permission to "true", always returns "true" no care about the role that you are updating....&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;public boolean hasScopeResourcePermission(
            long companyId, String name, int scope, long roleId,
            String actionId)
        throws PortalException {

        ResourceAction resourceAction =
            resourceActionLocalService.getResourceAction(name, actionId);

[color=#ff0000]        [b]List&amp;lt;resourcepermission&amp;gt; resourcePermissions =
            resourcePermissionPersistence.findByC_N_S(companyId, name, scope);[/b][/color]

        for (ResourcePermission resourcePermission : resourcePermissions) {
            if (resourcePermission.hasAction(resourceAction)) {
                return true;
            }
        }

        return false;
    }&amp;lt;/resourcepermission&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;I have checked that this code has been updated in github:&lt;br&gt;&lt;br&gt;&lt;a href="https://github.com/liferay/liferay-portal/blob/master/portal-impl/src/com/liferay/portal/service/impl/ResourcePermissionLocalServiceImpl.java"&gt;https://github.com/liferay/liferay-portal/blob/master/portal-impl/src/com/liferay/portal/service/impl/ResourcePermissionLocalServiceImpl.java&lt;br&gt;&lt;br&gt;&lt;/a&gt;&lt;pre&gt;&lt;code&gt;public boolean hasScopeResourcePermission(
    long companyId, String name, int scope, long roleId,
    String actionId)
    throws PortalException {

    ResourceAction resourceAction =
        resourceActionLocalService.getResourceAction(name, actionId);

[color=#006400][b]    List&amp;lt;resourcepermission&amp;gt; resourcePermissions =
        resourcePermissionPersistence.findByC_N_S_R(
            companyId, name, scope, roleId);[/b][/color]

    for (ResourcePermission resourcePermission : resourcePermissions) {
        if (resourcePermission.hasAction(resourceAction)) {
            return true;
        }
    }

    return false;
}&amp;lt;/resourcepermission&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;I don't know if it is included in the new versión 7.1.3 GA4... I'll deploy it this week.&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;Santiago&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Santiago Pérez de la Cámara</dc:creator>
    <dc:date>2019-05-14T11:03:00Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7.1.2: I can't modify the default permissions for the role User</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113619619" />
    <author>
      <name>Santiago Pérez de la Cámara</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113619619</id>
    <updated>2019-05-13T15:38:28Z</updated>
    <published>2019-05-13T15:38:28Z</published>
    <summary type="html">Hi Tomas:&lt;br /&gt;Please, find attached the result file for the SQL.&lt;br /&gt;&lt;br /&gt;Let me explain a little more aboute the problem I found. &lt;br /&gt;As Administrator I try to change permissions for the &amp;#34;User&amp;#34; role. For instance, the permissions by default for &amp;#34;Website administration -&amp;gt; Applications -&amp;gt; Documents and Media&amp;#34; and resource &amp;#34;com.liferay.document.library.kernel.model.DLFolder&amp;#34; are shown in image 1.&lt;br /&gt;&lt;br /&gt;I change the permissions just to &amp;#34;VIEW&amp;#34; and &amp;#34;ACCESS&amp;#34; (image 2). The database is updated and the field &amp;#34;ResourcePermissions.actionIds&amp;#34; with scope 1 has value 257 (VIEW = 1 + ACCESS = 256), but when the webpage is refreshed all the permissions are checked again (and the value in database remains 257!!!). &lt;br /&gt;&lt;br /&gt;Where is it loading that checked permissions for the role User?? It seems like someway the permissions in database are overwritten with other permissions.... from where???&lt;br /&gt;&lt;br /&gt;In addition, when the user logs in the web, the &amp;#34;permissionChecker&amp;#34; gets the permissions shown in image 1, not those in the database.&lt;br /&gt;&lt;br /&gt;Thanks in advance!&lt;br /&gt;Santiago</summary>
    <dc:creator>Santiago Pérez de la Cámara</dc:creator>
    <dc:date>2019-05-13T15:38:28Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7.1.2: I can't modify the default permissions for the role User</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113618205" />
    <author>
      <name>Tomáš Polešovský</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113618205</id>
    <updated>2019-05-13T13:33:28Z</updated>
    <published>2019-05-13T13:33:28Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;If you have MySQL this should return the important info:&lt;br&gt;​&lt;pre&gt;&lt;code&gt;SELECT 
  r.name roleName, 
  g.name groupName, 
  rp.*, 
  (SELECT group_concat(ra.actionId) from ResourceAction ra where ra.name = rp.name and ra.bitwiseValue &amp;amp;amp; rp.actionIds &amp;amp;gt; 0) actions
FROM ResourcePermission rp
  INNER JOIN Role_ r on r.roleId = rp.roleId
  LEFT JOIN Group_ g on g.groupId = rp.primKey

WHERE rp.name = 'com.liferay.document.library';
&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Tomáš Polešovský</dc:creator>
    <dc:date>2019-05-13T13:33:28Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7.1.2: I can't modify the default permissions for the role User</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113617815" />
    <author>
      <name>Tomáš Polešovský</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113617815</id>
    <updated>2019-05-13T13:04:08Z</updated>
    <published>2019-05-13T13:04:08Z</published>
    <summary type="html">Hi Santiago,&lt;br /&gt;&lt;blockquote&gt;By default, the role &amp;#34;User&amp;#34; has configured permissions for the &amp;#34;Documents and Multimedia&amp;#34; application, for instance: &amp;#34;Add a subfolder&amp;#34;, &amp;#34;Add a document&amp;#34;, &amp;#34;Update a document&amp;#34; and so on.&lt;/blockquote&gt;The default permissions are defined on Site Memeber role, not User role.&lt;br /&gt;7.0.6: &lt;a href="https://github.com/liferay/liferay-portal/blob/7.0.6-ga7/portal-impl/src/resource-actions/documentlibrary.xml#L27-L33"&gt;https://github.com/liferay/liferay-portal/blob/7.0.6-ga7/portal-impl/src/resource-actions/documentlibrary.xml#L27-L33&lt;br /&gt;&lt;/a&gt;7.1.2: &lt;a href="https://github.com/liferay/liferay-portal/blob/7.1.2-ga3/portal-impl/src/resource-actions/documentlibrary.xml#L27-L33"&gt;https://github.com/liferay/liferay-portal/blob/7.1.2-ga3/portal-impl/src/resource-actions/documentlibrary.xml#L27-L33&lt;br /&gt;&lt;br /&gt;&lt;/a&gt;I&amp;#39;m guessing this comes from upgrade, probably something that was assigned directly to the User role.&lt;br /&gt;&lt;br /&gt;Can you show content of ResourcePermission table where name = &amp;#39;com.liferay.document.library&amp;#39;?&lt;br /&gt;&lt;br /&gt;​​​​​​​Thanks.</summary>
    <dc:creator>Tomáš Polešovský</dc:creator>
    <dc:date>2019-05-13T13:04:08Z</dc:date>
  </entry>
  <entry>
    <title>Liferay 7.1.2: I can't modify the default permissions for the role User</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113593962" />
    <author>
      <name>Santiago Pérez de la Cámara</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113593962</id>
    <updated>2019-05-10T11:53:01Z</updated>
    <published>2019-05-10T11:53:01Z</published>
    <summary type="html">Hi everyone:&lt;br /&gt;I&amp;#39;m working with the version 7.1.2 CE upgraded from 7.0.6 CE.&lt;br /&gt;&lt;br /&gt;By default, the role &amp;#34;User&amp;#34; has configured permissions for the &amp;#34;Documents and Multimedia&amp;#34; application, for instance: &amp;#34;Add a subfolder&amp;#34;, &amp;#34;Add a document&amp;#34;, &amp;#34;Update a document&amp;#34; and so on.&lt;br /&gt;&lt;br /&gt;I don&amp;#39;t want users to be able to upload/update/delete documents, so when I uncheck the appropiate permissions and save them the system displays a successfull message, but the permissions haven&amp;#39;t be updated. Nothing has changed.&lt;br /&gt;&lt;br /&gt;No errors are throwed in the log files...&lt;br /&gt;&lt;br /&gt;Isn&amp;#39;t it possible to change the default permissions for the role &amp;#34;User&amp;#34;? Is it a bug?&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Santiago</summary>
    <dc:creator>Santiago Pérez de la Cámara</dc:creator>
    <dc:date>2019-05-10T11:53:01Z</dc:date>
  </entry>
</feed>
