fix: PHP 7.4 compatibility

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2024-01-09 18:08:53 +01:00
parent 635880a27b
commit 16e5b36d2f
5 changed files with 14 additions and 14 deletions

View File

@@ -98,7 +98,11 @@ class PermissionService {
* @param $boardId
* @return bool|array
*/
public function getPermissions($boardId) {
public function getPermissions($boardId, ?string $userId = null) {
if ($userId === null) {
$userId = $this->userId;
}
if ($cached = $this->permissionCache->get($boardId)) {
return $cached;
}
@@ -113,7 +117,7 @@ class PermissionService {
Acl::PERMISSION_SHARE => ($owner || $this->userCan($acls, Acl::PERMISSION_SHARE))
&& (!$this->shareManager->sharingDisabledForUser($this->userId))
];
$this->permissionCache->set($boardId, $permissions);
$this->permissionCache->set((string)$boardId, $permissions);
return $permissions;
}
@@ -169,7 +173,7 @@ class PermissionService {
}
try {
$acls = $this->getBoard($boardId)->getAcl() ?? [];
$acls = $this->getBoard((int)$boardId)->getAcl() ?? [];
$result = $this->userCan($acls, $permission, $userId);
if ($result) {
return true;