Skip to content

Commit 97bee01

Browse files
committed
add permission check
Signed-off-by: samin-z <samin.zavarkesh@gmail.com>
1 parent 822f413 commit 97bee01

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
@@ -10,6 +10,7 @@
1010
use OCA\Deck\Db\Acl;
1111
use OCA\Deck\Db\BoardMapper;
1212
use OCA\Deck\Service\ConfigService;
13+
use OCA\Deck\Service\PermissionService;
1314
use OCP\AppFramework\Http\DataResponse;
1415
use OCP\AppFramework\Http\NotFoundResponse;
1516
use OCP\AppFramework\OCSController;
@@ -39,6 +40,14 @@ public function get(): DataResponse {
3940
* @NoAdminRequired
4041
*/
4142
public function setValue(string $key, $value) {
43+
if (preg_match('/^board:(\d+):/', $key, $matches) === 1) {
44+
$this->permissionService->checkPermission(
45+
$this->boardMapper,
46+
(int)$matches[1],
47+
Acl::PERMISSION_EDIT,
48+
);
49+
}
50+
4251
$result = $this->configService->set($key, $value);
4352
if ($result === null) {
4453
return new NotFoundResponse();

0 commit comments

Comments
 (0)