. * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ namespace Espo\Classes\AclPortal\Pipeline; use Espo\Core\Acl\AccessEntityCREDChecker; use Espo\Core\Acl\ScopeData; use Espo\Core\Portal\AclManager as PortalAclManager; use Espo\Entities\Pipeline; use Espo\Entities\User; use Espo\ORM\Entity; /** * @implements AccessEntityCREDChecker */ class AccessChecker implements AccessEntityCREDChecker { public function __construct( private PortalAclManager $aclManager ) {} public function check(User $user, ScopeData $data): bool { return $data->isTrue(); } public function checkCreate(User $user, ScopeData $data): bool { return false; } public function checkRead(User $user, ScopeData $data): bool { return $data->isTrue(); } public function checkEdit(User $user, ScopeData $data): bool { return false; } public function checkDelete(User $user, ScopeData $data): bool { return false; } public function checkEntityCreate(User $user, Entity $entity, ScopeData $data): bool { return false; } public function checkEntityDelete(User $user, Entity $entity, ScopeData $data): bool { return false; } public function checkEntityEdit(User $user, Entity $entity, ScopeData $data): bool { return false; } public function checkEntityRead(User $user, Entity $entity, ScopeData $data): bool { if (!$data->isFalse()) { return false; } if (!$this->aclManager->checkScope($user, $entity->getTargetEntityType())) { return false; } if ($entity->isAvailableForAll()) { return true; } return false; } }