/** * @param $ref int the reference id of the datacollection object to check. * * @deprecated * @return bool whether or not the current user has add/edit_entry access to the referenced datacollection */ public static function _hasReadAccess($ref) { return ilObjDataCollectionAccess::_hasReadAccess($ref); }
/** * @param int $ref_id * @param $record ilDataCollectionRecord * * @return bool */ public function hasPermissionToViewRecord($ref_id, $record) { global $ilUser, $rbacreview; /** @var ilRbacReview $rbacreview */ // Owner of the DataCollection object and ILIAS Administrators can view each record by default if ($this->getCollectionObject()->getOwner() == $ilUser->getId() || $rbacreview->isAssigned($ilUser->getId(), 2)) { return true; } if (ilObjDataCollectionAccess::_hasReadAccess($ref_id)) { // Check for view only own entries setting if ($this->getViewOwnRecordsPerm() && $ilUser->getId() != $record->getOwner()) { return false; } return true; } return false; }