Issue
-
By default, when from the control panel someone creates a folder inside the document library the default permission is that everyone can see the folder (Guest User) and also that site member has other permissions to this new folder, like create document or create subfolder.
The question is: is there a way to override this mechanism? Because it is not always true that a site member could have the privileges to manipulate the document and media library.
Environment
- DXP 7.1
- DXP 7.2
- DXP 7.3
Resolution
DXP 7.1 - DXP 7.3
-
The default permissions assigned for site members and for guest on a newly created document folder are defined in the
documentlibrary.xml
file located in tomcat_home\webapps\ROOT\WEB-INF\lib\portal-impl.jar\resource-actions. And you can override these settings the following way:
To perform this, go to tomcat_home\webapps\ROOT\WEB-INF\classes\ and create a new folder named resource-actions. Copy and paste the documentlibrary.xml file located in tomcat_home\webapps\ROOT\WEB-INF\lib\portal-impl.jar\resource-actions\ into the new folder. Edit the newly created file to revoke the permissions you wish to restrict (in this case you probably need to look at the
<model-resource>
<model-name>com.liferay.document.library.kernel.model.DLFolder</model-name>
part, and within that, this part (if you want to remove some of the default permissions assigned to site members):
<site-member-defaults>
<action-key>ADD_DOCUMENT</action-key>
<action-key>ADD_SHORTCUT</action-key>
<action-key>ADD_SUBFOLDER</action-key>
<action-key>SUBSCRIBE</action-key>
<action-key>VIEW</action-key>
</site-member-defaults>