func must have signature func(user, privilege) and return a boolean.

def register(self, func):
        """
        func must have signature func(user, privilege) and return a boolean.
        """
        assert callable(func)
        assert inspect.getargspec(func).args == ["user", "privilege"]
        self.handlers.add(func)