Return true if user is restricted in download on the collection

@param  int     $base_id
@return boolean
775486
public function is_restricted_download($base_id)
    {
        $this->load_rights_bas();

        if (!$this->has_access_to_base($base_id)) {
            return false;
        }

        return $this->_rights_bas[$base_id][self::RESTRICT_DWNLD];
    }
293124
public function isOnline(int $user_id): bool
    {
        if (isset($this->_online_status_cached[$user_id])) {
            return $this->_online_status_cached[$user_id];
        }

        // Check session for current user exists
        $sessions = new UsersSessionEntityRepository();
        $sessions->setWhereUserId($user_id);
        $sessions->setLimit(1);
        $sessions->addWhereFieldIsHigher('ts', (NOW - 120)); // 2 minutes

        return $this->_online_status_cached[$user_id] = $sessions->hasAnyObjectInCollection();
    }
1273037
public function isIPRestricted($storeId = null)
    {
        $clientIP = $this->getClientIp();
        $whitelist = $this->getIPWhitelistArray($storeId);
        return $whitelist && ! in_array($clientIP, $whitelist);
    }
50263
public function block($id_chat): bool
  {
    if ( $this->is_admin($id_chat) ){
      return (bool)$this->db->update('bbn_chats', ['blocked' => 1], ['id' => $id_chat]);
    }
    return false;
  }
1007902
public function validateFileCollectionItem($file_id)
    {
        $file = $this->file->get($file_id);

        if (empty($file)) {
            return $this->translation->text('@name is unavailable', array(
                '@name' => $this->translation->text('File')));
        }

        return true;
    }
131727
public function getDownload4Id($id)
    {
        $query = $this->createQueryBuilder('p')
            ->select('p')
            ->where('p.id = :id')
            ->setParameter('id', $id)
            ->setMaxResults(1)
            ->getQuery();

        return $query->getOneOrNullResult();
    }
740661
function (target_id) {
            if ( ! target_id) { return false; }
            for (var i = 0; i < this._disabledInputs.length; i++) {
                if (this._disabledInputs[i] == target_id) { return true; }
            }
            return false;
        }
224746
public function canEdit(): bool
    {
        if ($this->isPendingDeletion()) {
            return false;
        }

        if (Auth::isManager($this->record->tree())) {
            return true;
        }

        // Members cannot edit RESN, CHAN and locked records
        return Auth::isEditor($this->record->tree()) && strpos($this->gedcom, "\n2 RESN locked") === false && $this->getTag() !== 'RESN' && $this->getTag() !== 'CHAN';
    }
826659
public function isUnderDownloadFolder()
    {
        $storageLocation = realpath($this->getStoreLocation());

        if ($storageLocation === false) {
            return false;
        }

        $downloadFolder = realpath($this->_getBaseDownloadDirPath());

        return strpos($storageLocation, $downloadFolder) !== false;
    }
740663
public function get_mask_xor($base_id)
    {
        $this->load_rights_bas();
        if (!$this->has_access_to_base($base_id)) {
            return false;
        }

        return $this->_rights_bas[$base_id]['mask_xor'];
    }
742842
public function canPublish()
    {
        // Override any default behaviour, to allow queuedjobs to complete
        if ($this->isPublishJobRunning()) {
            return true;
        }

        if ($active = $this->getWorkflowInstance()) {
            $publish = $active->canPublishTarget($this->owner);
            if (!is_null($publish)) {
                return $publish;
            }
        }

        // use definition to determine if publishing directly is allowed
        $definition = $this->getWorkflowService()->getDefinitionFor($this->owner);

        if ($definition) {
            if (!Security::getCurrentUser()) {
                return false;
            }
            $member = Security::getCurrentUser();

            $canPublish = $definition->canWorkflowPublish($member, $this->owner);

            return $canPublish;
        }
    }
1209867
public function isConstrained()
    {
        $source = $this->definition->sourceContext();
        $target = $this->definition->targetContext();
        if (empty($target)) {
            return false;
        }

        if ($source->getDatabase() != $target->getDatabase()) {
            //Unable to create constrains for records in different databases
            return false;
        }

        return $this->option(Record::CREATE_CONSTRAINT);
    }
128588
public function isRoot($work_id=-1)
	{

		if($work_id != -1){
			return array_search($work_id, $this->rootWorkIdList) === false ? false : true;
		}else{
			return array_search($this->self->work_id, $this->rootWorkIdList) === false ? false : true;
		}
		
	}
805223
public function AllowDiscountForNonUsers()
    {
        $bIsValid = true;
        $aExtranetGroup = $this->GetFieldDataExtranetGroupWithInverseEmptySelectionLogicIdList();
        if (null === $aExtranetGroup || count($aExtranetGroup) > 0) {
            $bIsValid = false;
        }

        if ($bIsValid) {
            $aExtranetUser = $this->GetFieldDataExtranetUserWithInverseEmptySelectionLogicIdList();
            if (null === $aExtranetUser || count($aExtranetUser) > 0) {
                $bIsValid = false;
            }
        }
        if ($bIsValid) {
            $aExtranetUserCountry = $this->GetMLTIdList('data_country_mlt');
            if (count($aExtranetUserCountry) > 0) {
                $bIsValid = false;
            }
        }

        return $bIsValid;
    }
36384
public static function queryByBaseId( $baseId, $config = [] ) {

		$type	= isset( $config[ 'type' ] ) ? $config[ 'type' ] : self::TYPE_COMMENT;
		$status	= isset( $config[ 'status' ] ) ? $config[ 'status' ] : self::STATUS_APPROVED;

		return self::find()->where( [ 'baseId' => $baseId, 'type' => $type, 'status' => $status ] );
	}
736158
protected function unlockAllDocuments($transaction_id)
    {
        $result = $this->getLocksCollection()->deleteMany(array(_LOCKED_FOR_TRANS => $transaction_id), array('w' => 1));

        if(!$result->isAcknowledged()) {
            $this->errorLog(MONGO_LOCK,
                array(
                    'description'=>'Driver::unlockAllDocuments - Failed to unlock documents (transaction_id - ' .$transaction_id .')',
                    'mongoDriverError' => $this->getLastDBError($this->getLocksDatabase()),
                    $result
                )
            );
            throw new \Exception("Failed to unlock documents as part of transaction : ".$transaction_id);
        }
        return true;
    }
684434
public function isUpdateRequired() : bool
    {
        try {
            $query = 'SELECT data_hash FROM info LIMIT 1';
            $dataHash = '';
            foreach ($this->getAdapter()->query($query) as $row) {
                $dataHash = $row['data_hash'];
            }
            $return = ($dataHash !== $this->getDataVersionHash());
        } catch (ParserConditionNotSatisfiedException $e) {
            $return = true;
        } catch (ParserRuntimeException $e) {
            $return = true;
        }

        return $return;
    }