Skip to content

Commit

Permalink
Fix return type of AbstractObject\Dao::getPermissions - related to #1…
Browse files Browse the repository at this point in the history
  • Loading branch information
dvesh3 committed Aug 21, 2023
1 parent 6257165 commit c521787
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/DataObject/AbstractObject/Dao.php
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ public function getPermissions($type, $user, $quote = true)
$orderByType = $type ? ', `' . $type . '` DESC' : '';
$permissions = $this->db->fetchAssociative('SELECT ' . $queryType . ' FROM users_workspaces_object WHERE cid IN (' . implode(',', $parentIds) . ') AND userId IN (' . implode(',', $userIds) . ') ORDER BY LENGTH(cpath) DESC, FIELD(userId, ' . $user->getId() . ') DESC' . $orderByType . ' LIMIT 1');

return $permissions;
return $permissions ?: null;
} catch (\Exception $e) {
Logger::warn('Unable to get permission ' . $type . ' for object ' . $this->model->getId());
}
Expand Down

0 comments on commit c521787

Please sign in to comment.