stable

Clone or download

Read-only

feat(svn/el9): allow to disable default permissions

It's possible to deactivate default '[/]' block via web ui and REST API. XML import will be covered in a dedicated commit. A potential issue was caught during review: it would have been more accurate to associate "has default permissions" to the svnaccessfile history rather than the repository itself. When an admin select an old version of .SVNAccessFile, they can expect that the result will be exactly the permissions that were set back in time. However, with the default permission toggle at repository level it's not possible. However, this issue was caught late in the development and the use of "use old version" is supposed to be low. In order to not block the ability to migrate to el9 for subversion users, we decided the following tradeoff: - The use of default permission is recorded in Project History (so we know the status of previous version of .SVNAccessFile) - It's no longer possible to save the used version, the svn admin only have the information to compare, it reduces the risk of misuse. How to test ----------- In GUI you can untick `Use default permissions` then only `[groups]` block is generated by Tuleap. In REST you can create / update repositories with or without `[/]` as well as specific permissions. Part of: request #31541 svn 1.10+ no longer supports duplicate sections Change-Id: Idb2d251244987d5efdc68290bb717b1323562834

Modified Files

Name
M plugins/svn/bin/migrate_to_plugin.php +1 −0 Go to diff View file
M plugins/svn/composer.json +5 −0 Go to diff View file
M plugins/svn/db/install.sql +1 −0 Go to diff View file
A plugins/svn/db/mysql/updates/2024/202401250900_add_has_default_permissions_to_repositories.php +44 −0 Go to diff View file
M plugins/svn/include/REST/v1/FullRepositoryRepresentation.php +4 −3 Go to diff View file
M plugins/svn/include/REST/v1/RepositoryResource.php +7 −3 Go to diff View file
M plugins/svn/include/REST/v1/RepositoryResourceUpdater.php +5 −1 Go to diff View file
M plugins/svn/include/REST/v1/SettingsGETRepresentation.php +14 −5 Go to diff View file
M plugins/svn/include/REST/v1/SettingsPOSTRepresentation.php +5 −0 Go to diff View file
M plugins/svn/include/REST/v1/SettingsPUTRepresentation.php +5 −0 Go to diff View file
M plugins/svn/include/SVN/AccessControl/AccessControlController.php +11 −19 Go to diff View file
M plugins/svn/include/SVN/AccessControl/AccessControlPresenter.php +12 −12 Go to diff View file
M plugins/svn/include/SVN/AccessControl/AccessFileHistoryCreator.php +18 −6 Go to diff View file
M plugins/svn/include/SVN/Dao.php +15 −9 Go to diff View file
M plugins/svn/include/SVN/Migration/SettingsRetriever.php +2 −1 Go to diff View file
M plugins/svn/include/SVN/Repository/CoreRepository.php +13 −16 Go to diff View file
A plugins/svn/include/SVN/Repository/DefaultPermissions.php +33 −0 Go to diff View file
A plugins/svn/include/SVN/Repository/DefaultPermissionsDao.php +40 −0 Go to diff View file
M plugins/svn/include/SVN/Repository/RepositoryCreator.php +1 −0 Go to diff View file
M plugins/svn/include/SVN/Repository/RepositoryManager.php +9 −15 Go to diff View file
M plugins/svn/include/SVN/Repository/Settings/Settings.php +2 −2 Go to diff View file
M plugins/svn/include/SVN/Repository/Settings/SettingsBuilder.php +11 −4 Go to diff View file
M plugins/svn/include/SVN/Repository/SvnCoreAccess.php +14 −16 Go to diff View file
M plugins/svn/include/SVN/Repository/SvnRepository.php +11 −3 Go to diff View file
M plugins/svn/include/svnPlugin.php +3 −2 Go to diff View file
M plugins/svn/site-content/fr_FR/LC_MESSAGES/tuleap-svn.po +12 −7 Go to diff View file
M plugins/svn/site-content/pt_BR/LC_MESSAGES/tuleap-svn.po +6 −4 Go to diff View file
M plugins/svn/templates/admin/edit_authfile.mustache +7 −2 Go to diff View file
M plugins/svn/tests/unit/REST_Backend/RepositoryResourceUpdaterTest.php +51 −9 Go to diff View file
M plugins/svn/tests/unit/Reference/ExtractorTest.php +18 −1 Go to diff View file
A plugins/svn/tests/unit/Repository/DefaultPermissionsStub.php +46 −0 Go to diff View file
M plugins/svn/tests/unit/SVN/AccessFile/AccessFileHistoryCreatorTest.php +5 −0 Go to diff View file
M plugins/svn/tests/unit/SVN/Repository/RepositoryCreatorTest.php +8 −4 Go to diff View file
M plugins/svn/tests/unit/SVN/Repository/RepositoryManagerTest.php +11 −6 Go to diff View file
M plugins/svn/tests/unit/SVN/Repository/Settings/SettingsBuilderTest.php +3 −2 Go to diff View file
M plugins/svn/tests/unit/SVN/Repository/SvnCoreAccessTest.php +21 −5 Go to diff View file
M src/common/SVNCore/Repository.php +2 −0 Go to diff View file
M tests/unit/common/SVNCore/RepositoryStub.php +5 −0 Go to diff View file