Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
How to programmatically add permissions for a role for a document folder?
Hi there,
I have a folder in Liferay 7.4 document library, and I have to add a number of permissions for this folder to a certain role.
I tried using different functions from ResourcePermissionLocalServiceUtil for example: setResourcePermissions, addResourcePermission, updateResourcePermission. None of them work when my role does not have any permissions for the folder. All of them return an error :
No ResourcePermission exists with the key {companyId=20096, name=com.liferay.document.library.kernel.model.DLFolder, scope=4, primKey=56877, roleId=20106}
even though Liferay documentation says.: "
updateResourcePermission(ResourcePermission resourcePermission)
Updates the resource permission in the database or adds it if it does not yet exist" Any help is greatly appreciated. Thank you. Alla
|
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™