留言板

Automatic Guest permissions for all newly added documents

Ed F.,修改在14 年前。

Automatic Guest permissions for all newly added documents

Expert 帖子: 280 加入日期: 06-6-27 最近的帖子
I have a portlet that uses Document Library for uploads. I'm calling DLFileEntryLocalServiceUtil.addFileEntry, and I supply true for addCommunityPermissions and addGuestPermissions, but every file that's uploaded is still not accessible to guests. The only way I can see to fix it is to manually add guest view permissions to each file as it's uploaded. This is getting tedious.

The folder has guest view permissions. It's not in a private page. Adding guest view permissions to each file works.

Anyone know of a way that every file added to a certain folder automatically is viewable by guests?

Thanks!
-Ed
thumbnail
Minhchau Dang,修改在14 年前。

RE: Automatic Guest permissions for all newly added documents

Liferay Master 帖子: 598 加入日期: 07-10-22 最近的帖子
The "addCommunityPermissions" and "addGuestPermissions" refer to the values specified in [url=http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Using+Liferay's+Permission+System+from+a+portlet]resource actions.

Currently, there is no built-in way for files to automatically inherit the permissions of their parent folders, meaning that in the current code base, you will need to apply code customizations (most likely a model listener) to add those permissions.