stable

Clone or download

Read-only

story #24981: forbid deletion of documents and versions by WRITERS

The behaviour is configured in "Manage permissions" page of docman administration there is a switch "Forbid deletion of document & versions by Writers". When activated, only Managers or Docman Administrators can delete stuff in docman/documents. This applies: * in SOAP API * in REST API * in WebDav * in docman "legacy" interface * in Document app Note: \WebDAVDocmanFile::delete() is updated so that it return MethodNotAllowed the same way \WebDAVDocmanFile::rename() does. Change-Id: Icde65e5874b6821d0e8590adb1060224d240c439

Modified Files

Name
M plugins/docman/db/install.sql +1 −0 Go to diff View file
A plugins/docman/db/mysql/updates/2022/202203101725_add_writers_allowed_to_delete.php +44 −0 Go to diff View file
M plugins/docman/include/Docman_Actions.class.php +2 −1 Go to diff View file
M plugins/docman/include/Docman_Controller.class.php +1 −2 Go to diff View file
M plugins/docman/include/Docman_ItemFactory.class.php +1 −1 Go to diff View file
M plugins/docman/include/Docman_PermissionsManager.class.php +36 −27 Go to diff View file
A plugins/docman/include/Item/SubItemsDeletableVisitor.php +93 −0 Go to diff View file
R plugins/docman/include/Settings/ForbidWritersToUpdateDAOSettings.php Go to diff View file
R plugins/docman/include/Settings/ForbidUpdatePropertiesSettings.php Go to diff View file
R plugins/docman/include/Settings/ITellIfWritersAreAllowedToUpdateProperties.php Go to diff View file
M plugins/docman/include/Settings/SettingsDAO.php +9 −5 Go to diff View file
M plugins/docman/include/view/Docman_View_Admin_Permissions.class.php +1 −0 Go to diff View file
M plugins/docman/site-content/fr_FR/LC_MESSAGES/tuleap-docman.po +10 −0 Go to diff View file
M plugins/docman/templates/admin/permissions-addendum.mustache +15 −0 Go to diff View file
M plugins/docman/tests/rest/Docman/ForbidWritersTest.php +35 −3 Go to diff View file
M plugins/docman/tests/rest/DocmanForbidWritersDataBuilder.php +2 −1 Go to diff View file
M plugins/docman/tests/soap/DocmanTest.php +24 −0 Go to diff View file
A plugins/docman/tests/unit/Item/SubItemsDeletableVisitorTest.php +122 −0 Go to diff View file
M plugins/docman/tests/unit/PermissionManager/Docman_PermissionsManagerTest.php +74 −33 Go to diff View file
R plugins/docman/tests/unit/Settings/ForbidUpdatePropertiesSettingsTest.php Go to diff View file
M plugins/document/include/Tree/DocumentTreeController.php +5 −3 Go to diff View file
M plugins/document/include/Tree/DocumentTreePresenter.php +6 −0 Go to diff View file
M plugins/document/include/documentPlugin.php +1 −1 Go to diff View file
M plugins/document/scripts/document/components/Folder/ActionsQuickLookButton/QuickLookDeleteButton.test.ts +23 −16 Go to diff View file
M plugins/document/scripts/document/components/Folder/ActionsQuickLookButton/QuickLookDeleteButton.vue +9 −1 Go to diff View file
M plugins/document/scripts/document/components/Folder/DropDown/DropDownCurrentFolder.test.ts +28 −8 Go to diff View file
M plugins/document/scripts/document/components/Folder/DropDown/DropDownCurrentFolder.vue +9 −1 Go to diff View file
M plugins/document/scripts/document/components/Folder/DropDown/DropDownDisplayedEmbedded.test.ts +26 −6 Go to diff View file
M plugins/document/scripts/document/components/Folder/DropDown/DropDownDisplayedEmbedded.vue +9 −3 Go to diff View file
M plugins/document/scripts/document/components/Folder/DropDown/DropDownMenuTreeView.test.ts +51 −3 Go to diff View file
M plugins/document/scripts/document/components/Folder/DropDown/DropDownMenuTreeView.vue +10 −5 Go to diff View file
A plugins/document/scripts/document/helpers/can-delete-helper.test.ts +74 −0 Go to diff View file
A plugins/document/scripts/document/helpers/can-delete-helper.ts +28 −0 Go to diff View file
M plugins/document/scripts/document/index.js +2 −0 Go to diff View file
M plugins/document/scripts/document/store/configuration/index.ts +1 −0 Go to diff View file
M plugins/document/templates/document-tree.mustache +1 −0 Go to diff View file
M plugins/webdav/include/FS/WebDAVDocmanFile.class.php +10 −6 Go to diff View file
M plugins/webdav/include/WebDAVUtils.class.php +0 −1 Go to diff View file