protected function assignGroups() { if (count($this->getAssignedGroupes()) == 0) { return false; } foreach ($this->getAssignedGroupes() as $grp_obj_id) { if (ilObject2::_lookupType($grp_obj_id) != 'grp') { continue; } $part = ilGroupParticipants::_getInstanceByObjId($grp_obj_id); $usr_id = $this->getUsrObject()->getId(); $part->add($usr_id, IL_GRP_MEMBER); $all_refs = ilObject2::_getAllReferences($grp_obj_id); $first = array_shift(array_values($all_refs)); ilObjUser::_dropDesktopItem($usr_id, $first, 'grp'); } }
/** * * * @param * @return */ function checkAccessMobUsage($usage, $oid) { /** * @var $ilObjDataCache ilObjectDataCache */ global $ilObjDataCache; switch ($usage['type']) { case 'lm:pg': if ($oid > 0) { if ($this->checkAccessLM($oid, 'lm', $usage['id'])) { return true; } } break; case 'news': // media objects in news (media casts) include_once "./Modules/MediaCast/classes/class.ilObjMediaCastAccess.php"; include_once "./Services/News/classes/class.ilNewsItem.php"; if ($this->checkAccessObject($oid, 'mcst')) { return true; } elseif (ilObjMediaCastAccess::_lookupPublicFiles($oid) && ilNewsItem::_lookupVisibility($usage["id"]) == NEWS_PUBLIC) { return true; } break; case 'dcl:html': include_once "./Modules/DataCollection/classes/class.ilObjDataCollectionAccess.php"; include_once "./Services/Object/classes/class.ilObject2.php"; $ref_ids = ilObject2::_getAllReferences($oid); foreach ($ref_ids as $ref_id) { if (ilObjDataCollectionAccess::_checkAccess("view", "read", $ref_id, $oid)) { return true; } } break; case 'frm~:html': // $oid = userid foreach ($this->check_users as $user_id) { if ($ilObjDataCache->lookupType($oid) == 'usr' && $oid == $user_id) { return true; } } break; case 'qpl:pg': case 'qpl:html': // test questions if ($this->checkAccessTestQuestion($oid, $usage['id'])) { return true; } break; case 'gdf:pg': // special check for glossary terms if ($this->checkAccessGlossaryTerm($oid, $usage['id'])) { return true; } break; case 'sahs:pg': // check for scorm pages if ($this->checkAccessObject($oid, 'sahs')) { return true; } break; case 'prtf:pg': // special check for portfolio pages if ($this->checkAccessPortfolioPage($oid, $usage['id'])) { return true; } break; case 'blp:pg': // special check for blog pages if ($this->checkAccessBlogPage($oid, $usage['id'])) { return true; } break; default: // standard object check if ($this->checkAccessObject($oid)) { return true; } break; } return false; }
/** * @param $data_collection_id * * @return bool */ public static function _checkAccess2($data_collection_id) { global $ilAccess; $perm = false; $references = ilObject2::_getAllReferences($data_collection_id); if ($ilAccess->checkAccess("add_entry", "", array_shift($references))) { $perm = true; } return $perm; }
/** * @param $action * @param $obj_id * * @return bool */ public static function checkActionForObjId($action, $obj_id) { foreach (ilObject2::_getAllReferences($obj_id) as $ref_id) { if (self::checkActionForRefId($action, $ref_id)) { return true; } } return false; }