Example #1
0
    def GetGrrUser(self, args, token=None):
        # Everybody can get their own user object.

        interface_traits = api_user.ApiGrrUserInterfaceTraits(
            search_clients_action_enabled=True)
        return api_user.ApiGetOwnGrrUserHandler(
            interface_traits=interface_traits)
Example #2
0
  def testRendersTraitsPassedInConstructor(self):
    result = self.handler.Handle(
        None, token=access_control.ACLToken(username="******"))
    self.assertFalse(result.interface_traits.create_hunt_action_enabled)

    handler = user_plugin.ApiGetOwnGrrUserHandler(
        interface_traits=user_plugin.ApiGrrUserInterfaceTraits(
            create_hunt_action_enabled=True))
    result = handler.Handle(None, token=access_control.ACLToken(username="******"))
    self.assertTrue(result.interface_traits.create_hunt_action_enabled)
    def GetGrrUser(self, args, token=None):
        # Everybody can get their own user settings.

        interface_traits = api_user.ApiGrrUserInterfaceTraits().EnableAll()
        try:
            self.CheckIfUserIsAdmin(token=token)
        except access_control.UnauthorizedAccess:
            interface_traits.manage_binaries_nav_item_enabled = False

        return api_user.ApiGetOwnGrrUserHandler(
            interface_traits=interface_traits)
 def GetGrrUser(self, args, token=None):
     return api_user.ApiGetOwnGrrUserHandler(
         interface_traits=api_user.ApiGrrUserInterfaceTraits().EnableAll())
Example #5
0
 def setUp(self):
     super(ApiGetOwnGrrUserHandlerTest, self).setUp()
     self.handler = user_plugin.ApiGetOwnGrrUserHandler()