public function check($scope, $name, $keyType, $accessMask)
    {
        // there's no "Account" type on the access bits level
        $type = ($keyType == 'Account') ? 'Character' : $keyType;

        // no keyinfo configuration found
        // assume it's a public call or it's not yet defined
        // allow and let the CCP decide
        if (!$keyType
            || !in_array($type, array('Character', 'Corporation'))
            || !isset($this->bits[strtolower($scope)][strtolower($name)])
        ) {
            return true;
        }

        // check accessLevel
        $check = $this->bits[strtolower($scope)][strtolower($name)];

        // check if keytype is correct for this call
        if ($check[0] == $type) {
            // check single accessbit
            if (is_int($check[1]) && (int)$accessMask & (int)$check[1]) {
                return true;
            }

            // fix if multiple accessbits are valid (eve/CharacterInfo)
            //elseif(is_array($check[1]))
            //    foreach($check[1] as $checkbit)
            //        if($checkbit && $checkbit & $accessMask)
            //            return true;
        }

        // no match == no access right found.
        throw new AccessException(
            sprintf(
                'Pheal blocked an API call (%s/%s) which is not allowed by the given keyType/accessMask (%s/%d)',
                $scope,
                $name,
                $keyType,
                $accessMask
            )
        );
    }
public function check($scope, $name, $keyType, $accessMask)
    {
        // there's no "Account" type on the access bits level
        $type = ($keyType == 'Account') ? 'Character' : $keyType;

        // no keyinfo configuration found
        // assume it's a public call or it's not yet defined
        // allow and let the CCP decide
        if (!$keyType
            || !in_array($type, array('Character', 'Corporation'))
            || !isset($this->bits[strtolower($scope)][strtolower($name)])
        ) {
            return true;
        }

        // check accessLevel
        $check = $this->bits[strtolower($scope)][strtolower($name)];

        // check if keytype is correct for this call
        if ($check[0] == $type) {
            // check single accessbit
            if (is_int($check[1]) && (int)$accessMask & (int)$check[1]) {
                return true;
            }

            // fix if multiple accessbits are valid (eve/CharacterInfo)
            //elseif(is_array($check[1]))
            //    foreach($check[1] as $checkbit)
            //        if($checkbit && $checkbit & $accessMask)
            //            return true;
        }

        // no match == no access right found.
        throw new AccessException(
            sprintf(
                'Pheal blocked an API call (%s/%s) which is not allowed by the given keyType/accessMask (%s/%d)',
                $scope,
                $name,
                $keyType,
                $accessMask
            )
        );
    }
public function check ( $ scope , $ name , $ keyType , $ accessMask ) { // there's no "Account" type on the access bits level $ type = ( $ keyType == 'Account' ) ? 'Character' : $ keyType ; // no keyinfo configuration found // assume it's a public call or it's not yet defined // allow and let the CCP decide if ( ! $ keyType || ! in_array ( $ type , array ( 'Character' , 'Corporation' ) ) || ! isset ( $ this -> bits [ strtolower ( $ scope ) ] [ strtolower ( $ name ) ] ) ) { return true ; } // check accessLevel $ check = $ this -> bits [ strtolower ( $ scope ) ] [ strtolower ( $ name ) ] ; // check if keytype is correct for this call if ( $ check [ 0 ] == $ type ) { // check single accessbit if ( is_int ( $ check [ 1 ] ) && ( int ) $ accessMask & ( int ) $ check [ 1 ] ) { return true ; } // fix if multiple accessbits are valid (eve/CharacterInfo) //elseif(is_array($check[1])) //    foreach($check[1] as $checkbit) //        if($checkbit && $checkbit & $accessMask) //            return true; } // no match == no access right found. throw new AccessException ( sprintf ( 'Pheal blocked an API call (%s/%s) which is not allowed by the given keyType/accessMask (%s/%d)' , $ scope , $ name , $ keyType , $ accessMask ) ) ; }
Check if the api key is allowed to make this api call
@param string $scope
@param string $name
@param string $keyType
@param int $accessMask
@throws \Pheal\Exceptions\AccessException
@return bool
Check if the api key is allowed to make this api call