def authorize_quota_class_context(context, class_name):
 if is_user_context(context):
  if (not context.quota_class):
   raise exception.NotAuthorized()
  elif (context.quota_class != class_name):
   raise exception.NotAuthorized()

def authorize_quota_class_context ( context , class_name ) : if is_user_context ( context ) : if ( not context . quota_class ) : raise exception . NotAuthorized ( ) elif ( context . quota_class != class_name ) : raise exception . NotAuthorized ( )
ensures a request has permission to access the given quota class .