legacy-knowledge-base
公開されました Jun. 30, 2025

Some documents are missing the Download permission after an upgrade

投稿者

Sorin Pop

knowledge-article-header-disclaimer-how-to

knowledge-article-header-disclaimer

legacy-article

learn-legacy-article-disclaimer-text

Issue

  • After upgrading from 7.4u60 to 2024.Q1.4, users are unable to download files from documents and media. They are able to view the files, but the download permission isn't set on their roles. I understand the download permission was added in u75, and that this permission should have been automatically added to roles with the view permission during the upgrade process.
  • This seems to be manifesting itself as a problem at the document level. Documents uploaded after the upgrade to the quarterly release version have the download permission, but documents before that upgrade do not. This includes documents uploaded whilst on DXP 7.4 u31 and u60, as well as older documents from DXP 7.2.

Environment

  • 7.4

Resolution

  • We have limited knowledge about this phenomenon. It seems to happen for documents created while on older Liferay versions
  • there is a groovy script that might help with this issue (attached is a version for Oracle and one for MySQL)
  • below are some instructions on how to use it:

Create a database backup.

Make sure that for the first condition the bitwise for download permission is 256, and if not change it for the corresponding value:

 

 

dynamicQuery.add( RestrictionsFactoryUtil.sqlRestriction( "bitand(actionIds, 256) <= 0"));

 

Make sure that for the second condition the bitwise for view permission is 1, and if not change it for the corresponding value: :

 

 

dynamicQuery.add( RestrictionsFactoryUtil.sqlRestriction( "bitand(actionIds, 1) > 0"));

 

Note:

To check the bitwise value use this query:

SELECT * FROM ResourceAction where name like '%DLFileEntry' and actionId in ('DOWNLOAD','VIEW');

 

Go to the default instance.

  1. Then, go to applications menu
  2. Then, go to server administration and click on script tab
  3. Use default configuration: Language Groovy and output text
  4. Paste the groovy script and click on execute.
did-this-article-resolve-your-issue

legacy-knowledge-base