src/components/Auth.php
public function matchApi($userId, $apiEndpoint, $typeVerification = false)
    {
        $groups = $this->getApiTable($userId, $apiEndpoint);

        if ($typeVerification === false || $typeVerification === self::CAN_VIEW) {
            return (count($groups) > 0) ? true : false;
        }

        foreach ($groups as $row) {
            if ($this->permissionVerify($typeVerification, $this->permissionWeight($row['crud_create'], $row['crud_update'], $row['crud_delete']))) {
                return true;
            }
        }

        return false;
    }
public function matchApi($userId, $apiEndpoint, $typeVerification = false)
    {
        $groups = $this->getApiTable($userId, $apiEndpoint);

        if ($typeVerification === false || $typeVerification === self::CAN_VIEW) {
            return (count($groups) > 0) ? true : false;
        }

        foreach ($groups as $row) {
            if ($this->permissionVerify($typeVerification, $this->permissionWeight($row['crud_create'], $row['crud_update'], $row['crud_delete']))) {
                return true;
            }
        }

        return false;
    }
public function matchApi ( $ userId , $ apiEndpoint , $ typeVerification = false ) { $ groups = $ this -> getApiTable ( $ userId , $ apiEndpoint ) ; if ( $ typeVerification === false || $ typeVerification === self :: CAN_VIEW ) { return ( count ( $ groups ) > 0 ) ? true : false ; } foreach ( $ groups as $ row ) { if ( $ this -> permissionVerify ( $ typeVerification , $ this -> permissionWeight ( $ row [ 'crud_create' ] , $ row [ 'crud_update' ] , $ row [ 'crud_delete' ] ) ) ) { return true ; } } return false ; }
See if a User have rights to access this api.

@param integer $userId
@param string $apiEndpoint As defined in the Module.php like (api-admin-user) which is a unique identifiere
@param integer|string $typeVerification The CONST number provided from CAN_*
@return bool
See if a User have rights to access this api .