public function getChildPermissions($type, $user, $quote = true)
{
// $parentIds = $this->collectParentIds();
$userIds = $user->getRoles();
$userIds[] = $user->getId();
try {
if ($type && $quote) {
$type = "`" . $type . "`";
} else {
$type = "*";
}
$cid = $this->model->getId();
$sql = "SELECT " . $type . " FROM users_workspaces_object WHERE cid != " . $cid . " AND cpath LIKE " . $this->db->quote($this->model->getRealFullPath() . "%") . " AND userId IN (" . implode(",", $userIds) . ") ORDER BY LENGTH(cpath) DESC";
$permissions = $this->db->fetchAll($sql);
} catch (\Exception $e) {
Logger::warn("Unable to get permission " . $type . " for object " . $this->model->getId());
}
return $permissions;
}