public function getResourceUserPermission(ResourceInterface $resource, UserInterface $user)
    {
        $query = $this->getRepository()->createQueryBuilder('r')
            ->select('r')
            ->where('r.resource_class = :resourceClass AND r.resource_id=:resourceId AND r.user=:user')
            ->setParameter('resourceClass', $resource->getClass())
            ->setParameter('resourceId', $resource->getId())
            ->setParameter('user', $user)
            ->getQuery();

        return $query->getOneOrNullResult();
    }
public function getResourceUserPermission(ResourceInterface $resource, UserInterface $user)
    {
        $query = $this->getRepository()->createQueryBuilder('r')
            ->select('r')
            ->where('r.resource_class = :resourceClass AND r.resource_id=:resourceId AND r.user=:user')
            ->setParameter('resourceClass', $resource->getClass())
            ->setParameter('resourceId', $resource->getId())
            ->setParameter('user', $user)
            ->getQuery();

        return $query->getOneOrNullResult();
    }
public function getResourceUserPermission ( ResourceInterface $ resource , UserInterface $ user ) { $ query = $ this -> getRepository ( ) -> createQueryBuilder ( 'r' ) -> select ( 'r' ) -> where ( 'r.resource_class = :resourceClass AND r.resource_id=:resourceId AND r.user=:user' ) -> setParameter ( 'resourceClass' , $ resource -> getClass ( ) ) -> setParameter ( 'resourceId' , $ resource -> getId ( ) ) -> setParameter ( 'user' , $ user ) -> getQuery ( ) ; return $ query -> getOneOrNullResult ( ) ; }
Get resource-type permissions from the database

@param ResourceInterface $resource
@param UserInterface     $user

@return array
@throws \Doctrine\ORM\NonUniqueResultException
Get resource - type permissions from the database