diff --git a/apps/dav/lib/SystemTag/SystemTagPlugin.php b/apps/dav/lib/SystemTag/SystemTagPlugin.php index 428e71d91f4..d70eff17ac1 100644 --- a/apps/dav/lib/SystemTag/SystemTagPlugin.php +++ b/apps/dav/lib/SystemTag/SystemTagPlugin.php @@ -19,6 +19,7 @@ use OCP\SystemTag\ISystemTagManager; use OCP\SystemTag\ISystemTagObjectMapper; use OCP\SystemTag\TagAlreadyExistsException; use OCP\SystemTag\TagCreationForbiddenException; +use OCP\SystemTag\TagUpdateForbiddenException; use OCP\Util; use Sabre\DAV\Exception\BadRequest; use Sabre\DAV\Exception\Conflict; @@ -191,7 +192,7 @@ class SystemTagPlugin extends \Sabre\DAV\ServerPlugin { } catch (TagAlreadyExistsException $e) { throw new Conflict('Tag already exists', 0, $e); } catch (TagCreationForbiddenException $e) { - throw new Forbidden('You don’t have right to create tags', 0, $e); + throw new Forbidden('You don’t have permissions to create tags', 0, $e); } } @@ -472,7 +473,11 @@ class SystemTagPlugin extends \Sabre\DAV\ServerPlugin { } if ($updateTag) { - $node->update($name, $userVisible, $userAssignable, $color); + try { + $node->update($name, $userVisible, $userAssignable, $color); + } catch (TagUpdateForbiddenException $e) { + throw new Forbidden('You don’t have permissions to update tags', 0, $e); + } } return true; diff --git a/apps/settings/tests/Settings/Admin/ServerTest.php b/apps/settings/tests/Settings/Admin/ServerTest.php index f9c10d864e4..35a8a3ce7f7 100644 --- a/apps/settings/tests/Settings/Admin/ServerTest.php +++ b/apps/settings/tests/Settings/Admin/ServerTest.php @@ -85,6 +85,10 @@ class ServerTest extends TestCase { ->expects($this->any()) ->method('getValueString') ->willReturnCallback(fn ($a, $b, $default) => $default); + $this->appConfig + ->expects($this->any()) + ->method('getValueBool') + ->willReturnCallback(fn ($a, $b, $default) => $default); $this->profileManager ->expects($this->exactly(2)) ->method('isProfileEnabled') diff --git a/apps/systemtags/src/components/SystemTagPicker.vue b/apps/systemtags/src/components/SystemTagPicker.vue index 26a50c82e1f..601e48ea910 100644 --- a/apps/systemtags/src/components/SystemTagPicker.vue +++ b/apps/systemtags/src/components/SystemTagPicker.vue @@ -25,7 +25,7 @@