public function hasAccess($accessEntityUuid, $accessLevel)
    {
        // Do not check the database if we haven't all data
        if ($accessEntityUuid == '' || $accessLevel == '') {
            return false;
        }
        
        try {
            $queryBuilder = $this->entityManager->getQueryBuilder();
            $queryBuilder->select($queryBuilder->expr()->count('p.id'))
                         ->from('\\Zepi\\Core\\AccessControl\\Entity\\Permission', 'p')
                         ->where('p.accessEntityUuid = :accessEntityUuid')
                         ->andWhere('p.accessLevelKey = :accessLevel')
                         ->setParameter('accessEntityUuid', $accessEntityUuid)
                         ->setParameter('accessLevel', $accessLevel);
            
            $data = $queryBuilder->getQuery();
            if ($data === false) {
                return false;
            }
            
            return ($data->getSingleScalarResult() > 0);
        } catch (\Exception $e) {
            throw new Exception('Cannot verify the permission for uuid "' . $accessEntityUuid . '" and access level "' . $accessLevel . '".', 0, $e);
        }
    }
public function hasAccess($accessEntityUuid, $accessLevel)
    {
        // Do not check the database if we haven't all data
        if ($accessEntityUuid == '' || $accessLevel == '') {
            return false;
        }
        
        try {
            $queryBuilder = $this->entityManager->getQueryBuilder();
            $queryBuilder->select($queryBuilder->expr()->count('p.id'))
                         ->from('\\Zepi\\Core\\AccessControl\\Entity\\Permission', 'p')
                         ->where('p.accessEntityUuid = :accessEntityUuid')
                         ->andWhere('p.accessLevelKey = :accessLevel')
                         ->setParameter('accessEntityUuid', $accessEntityUuid)
                         ->setParameter('accessLevel', $accessLevel);
            
            $data = $queryBuilder->getQuery();
            if ($data === false) {
                return false;
            }
            
            return ($data->getSingleScalarResult() > 0);
        } catch (\Exception $e) {
            throw new Exception('Cannot verify the permission for uuid "' . $accessEntityUuid . '" and access level "' . $accessLevel . '".', 0, $e);
        }
    }
public function hasAccess ( $ accessEntityUuid , $ accessLevel ) { // Do not check the database if we haven't all data if ( $ accessEntityUuid == '' || $ accessLevel == '' ) { return false ; } try { $ queryBuilder = $ this -> entityManager -> getQueryBuilder ( ) ; $ queryBuilder -> select ( $ queryBuilder -> expr ( ) -> count ( 'p.id' ) ) -> from ( '\\Zepi\\Core\\AccessControl\\Entity\\Permission' , 'p' ) -> where ( 'p.accessEntityUuid = :accessEntityUuid' ) -> andWhere ( 'p.accessLevelKey = :accessLevel' ) -> setParameter ( 'accessEntityUuid' , $ accessEntityUuid ) -> setParameter ( 'accessLevel' , $ accessLevel ) ; $ data = $ queryBuilder -> getQuery ( ) ; if ( $ data === false ) { return false ; } return ( $ data -> getSingleScalarResult ( ) > 0 ) ; } catch ( \ Exception $ e ) { throw new Exception ( 'Cannot verify the permission for uuid "' . $ accessEntityUuid . '" and access level "' . $ accessLevel . '".' , 0 , $ e ) ; } }
Returns true if the given access entity uuid has already access to the
access level

@access public
@param string $accessEntityUuid
@param string $accessLevel
@return boolean

@throws \Zepi\Core\AccessControl\Exception Cannot verifiy the permission for uuid "{uuid}" and access level {accessLevel}.
Returns true if the given access entity uuid has already access to the access level