'Check simple quota limits.
For limits--those quotas for which there is no usage
synchronization function--this method checks that a set of
proposed values are permitted by the limit restriction.
This method will raise a QuotaResourceUnknown exception if a
given resource is unknown or if it is not a simple limit
resource.
If any of the proposed values is over the defined quota, an
OverQuota exception will be raised with the sorted list of the
resources which are too high.  Otherwise, the method returns
nothing.
:param context: The request context, for access checks.
:param resources: A dictionary of the registered resources.
:param values: A dictionary of the values to check against the
quota.
:param project_id: Specify the project_id if current context
is admin and admin wants to impact on
common user\'s tenant.
:param user_id: Specify the user_id if current context
is admin and admin wants to impact on
common user.'

def limit_check(self, context, resources, values, project_id=None, user_id=None):

    _valid_method_call_check_resources(values, 'check', resources)
    unders = [key for (key, val) in values.items() if (val < 0)]
    if unders:
        raise exception.InvalidQuotaValue(unders=sorted(unders))
    if (project_id is None):
        project_id = context.project_id
    if (user_id is None):
        user_id = context.user_id
    project_quotas = objects.Quotas.get_all_by_project(context, project_id)
    quotas = self._get_quotas(context, resources, values.keys(), project_id=project_id, project_quotas=project_quotas)
    user_quotas = self._get_quotas(context, resources, values.keys(), project_id=project_id, user_id=user_id, project_quotas=project_quotas)
    overs = [key for (key, val) in values.items() if (((quotas[key] >= 0) and (quotas[key] < val)) or ((user_quotas[key] >= 0) and (user_quotas[key] < val)))]
    if overs:
        headroom = {}
        for key in overs:
            headroom[key] = min((val for val in (quotas.get(key), project_quotas.get(key)) if (val is not None)))
        raise exception.OverQuota(overs=sorted(overs), quotas=quotas, usages={}, headroom=headroom)
