src/Policy/OrmResolver.php
protected function findPolicy($class, $name, $namespace)
    {
        $namespace = $this->getNamespace($namespace);
        $policyClass = false;

        // plugin entities can have application overides defined.
        if ($namespace !== $this->appNamespace) {
            $policyClass = App::className($name, 'Policy\\' . $namespace, 'Policy');
        }

        // Check the application/plugin.
        if ($policyClass === false) {
            $policyClass = App::className($namespace . '.' . $name, 'Policy', 'Policy');
        }

        if ($policyClass === false) {
            throw new MissingPolicyException([$class]);
        }

        return new $policyClass();
    }
protected function findPolicy($class, $name, $namespace)
    {
        $namespace = $this->getNamespace($namespace);
        $policyClass = false;

        // plugin entities can have application overides defined.
        if ($namespace !== $this->appNamespace) {
            $policyClass = App::className($name, 'Policy\\' . $namespace, 'Policy');
        }

        // Check the application/plugin.
        if ($policyClass === false) {
            $policyClass = App::className($namespace . '.' . $name, 'Policy', 'Policy');
        }

        if ($policyClass === false) {
            throw new MissingPolicyException([$class]);
        }

        return new $policyClass();
    }
protected function findPolicy ( $ class , $ name , $ namespace ) { $ namespace = $ this -> getNamespace ( $ namespace ) ; $ policyClass = false ; // plugin entities can have application overides defined. if ( $ namespace !== $ this -> appNamespace ) { $ policyClass = App :: className ( $ name , 'Policy\\' . $ namespace , 'Policy' ) ; } // Check the application/plugin. if ( $ policyClass === false ) { $ policyClass = App :: className ( $ namespace . '.' . $ name , 'Policy' , 'Policy' ) ; } if ( $ policyClass === false ) { throw new MissingPolicyException ( [ $ class ] ) ; } return new $ policyClass ( ) ; }
Locate a policy class using conventions

@param string $class The full class name.
@param string $name The name suffix of the resource.
@param string $namespace The namespace to find the policy in.
@throws \Authorization\Policy\Exception\MissingPolicyException When a policy for the
resource has not been defined.
@return object
Locate a policy class using conventions