Esempio n. 1
0
 def delete(self, oid=None):
     try:
         raise MethodNotAllowed
     except MethodNotAllowed as e:
         return error.format_exception(
             e,
             target=self.__class__.__name__.lower(),
             action='DEL')
Esempio n. 2
0
 def post(self):
     try:
         raise MethodNotAllowed
     except MethodNotAllowed as e:
         return error.format_exception(
             e,
             target=self.__class__.__name__.lower(),
             action='POST')
Esempio n. 3
0
 def delete(self, oid=None):
     try:
         raise MethodNotAllowed
     except MethodNotAllowed as e:
         return error.format_exception(
             e,
             target=self.__class__.__name__.lower(),
             action='DEL')
Esempio n. 4
0
 def post(self):
     try:
         raise MethodNotAllowed
     except MethodNotAllowed as e:
         return error.format_exception(
             e,
             target=self.__class__.__name__.lower(),
             action='POST')
Esempio n. 5
0
 def get(self, token):
     try:
         ensure_authorized_to('read', self._resource_name, token=token)
         user_tokens = self._get_all_tokens()
         if token:
             response = self._get_token(token, user_tokens)
         else:
             response = user_tokens
         return Response(json.dumps(response), mimetype='application/json')
     except Exception as e:
         return error.format_exception(e,
                                       target=self._resource_name,
                                       action='GET')
Esempio n. 6
0
 def get(self, token):
     try:
         getattr(require, self._resource_name).read()
         user_tokens = self._get_all_tokens()
         if token:
             response = self._get_token(token, user_tokens)
         else:
             response = user_tokens
         return Response(json.dumps(response), mimetype='application/json')
     except Exception as e:
         return error.format_exception(e,
                                       target=self._resource_name,
                                       action='GET')
Esempio n. 7
0
 def get(self, token):
     try:
         ensure_authorized_to('read', self._resource_name, token=token)
         user_tokens = self._get_all_tokens()
         if token:
             response = self._get_token(token, user_tokens)
         else:
             response = user_tokens
         return Response(json.dumps(response), mimetype='application/json')
     except Exception as e:
         return error.format_exception(
             e,
             target=self._resource_name,
             action='GET')
Esempio n. 8
0
 def get(self, token):
     try:
         getattr(require, self._resource_name).read()
         user_tokens = self._get_all_tokens()
         if token:
             response = self._get_token(token, user_tokens)
         else:
             response = user_tokens
         return Response(json.dumps(response), mimetype='application/json')
     except Exception as e:
         return error.format_exception(
             e,
             target=self._resource_name,
             action='GET')