public function isAssetAllowed(asset $asset) { if ($this->ks && $this->ks->verifyPrivileges(ks::PRIVILEGE_DOWNLOAD_ASSET, $asset->getId())) { return true; } return $this->isFlavorParamsAllowed($asset->getFlavorParamsId()); }
public function validateForDownload() { if ($this->ks) { if ($this->isKsAdmin()) { // no need to validate when ks is admin return; } if ($this->ks->verifyPrivileges(ks::PRIVILEGE_DOWNLOAD, ks::PRIVILEGE_WILDCARD)) { // no need to validate when we have wildcard download privilege return; } if ($this->ks->verifyPrivileges(ks::PRIVILEGE_DOWNLOAD, $this->entry->getId())) { // no need to validate when we have specific entry download privilege return; } } $this->validateForPlay(); }