예제 #1
0
 def check(self, controller):
     """ KB: [2010-09-23]: If it's an API call, then @api_method() (core.lib.decorators.api) will handle security. """
     if 'crm_logged_in' in controller.session and controller.session['crm_logged_in'] == True and ('user_id' in controller.session or is_api(controller.request)):
         return True
     raise NotValidAuth(self.message)
예제 #2
0
 def test_is_api(self):
     assert h.is_api(testing.DummyRequest()) == False