/** * Check access to media object * * @param * @return */ function checkAccessMob($obj_id) { $usages = ilObjMediaObject::lookupUsages($obj_id); foreach ($usages as $usage) { $oid = ilObjMediaObject::getParentObjectIdForUsage($usage, true); // for content snippets we must get their usages and check them if ($usage["type"] == "mep:pg") { include_once "./Modules/MediaPool/classes/class.ilMediaPoolPage.php"; $usages2 = ilMediaPoolPage::lookupUsages($usage["id"]); foreach ($usages2 as $usage2) { $oid2 = ilObjMediaObject::getParentObjectIdForUsage($usage2, true); if ($this->checkAccessMobUsage($usage2, $oid2)) { return true; } } } else { if ($this->checkAccessMobUsage($usage, $oid)) { return true; } } } return false; }