Skip to content

Commit abbe703

Browse files
committed
add permission check
Signed-off-by: samin-z <samin.zavarkesh@gmail.com>
1 parent f666df2 commit abbe703

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

lib/Controller/ConfigController.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use OCA\Deck\Db\Acl;
1010
use OCA\Deck\Db\BoardMapper;
1111
use OCA\Deck\Service\ConfigService;
12+
use OCA\Deck\Service\PermissionService;
1213
use OCP\AppFramework\Http\DataResponse;
1314
use OCP\AppFramework\Http\NotFoundResponse;
1415
use OCP\AppFramework\OCSController;
@@ -38,6 +39,14 @@ public function get(): DataResponse {
3839
* @NoAdminRequired
3940
*/
4041
public function setValue(string $key, $value) {
42+
if (preg_match('/^board:(\d+):/', $key, $matches) === 1) {
43+
$this->permissionService->checkPermission(
44+
$this->boardMapper,
45+
(int)$matches[1],
46+
Acl::PERMISSION_EDIT,
47+
);
48+
}
49+
4150
$result = $this->configService->set($key, $value);
4251
if ($result === null) {
4352
return new NotFoundResponse();

0 commit comments

Comments
 (0)