def __call__(self, klass=None): if klass is None: if 'factory' not in self.config: raise Exception('Must provide factory configuration when defining ' 'without a class') klass = get_caller_module() return super(_factory_decorator, self).__call__(klass)
def grant_all(principal=None, role=None): register_configuration( get_caller_module(), dict( principal=principal, role=role), 'grant_all')
def grant(principal=None, role=None, permission=None, permissions=None): register_configuration( get_caller_module(), dict(principal=principal, role=role, permission=permission, permissions=permissions), 'grant')
def permission(id, title, description=''): register_configuration( get_caller_module(), dict( id=id, title=title, description=description), 'permission')
def role(id, title, description='', local=True): register_configuration( get_caller_module(), dict( id=id, title=title, description=description, local=local), 'role')
def json_schema_definition(name: str, schema: dict) -> None: """ Register a json schema definition :param name: Name of schema :param schema: schema definition, must be json compatible """ register_configuration(get_caller_module(), dict(name=name, schema=schema), "json_schema_definition")
def grant(principal=None, role=None, permission=None, permissions=None): register_configuration( get_caller_module(), dict( principal=principal, role=role, permission=permission, permissions=permissions), 'grant')
def json_schema_definition(name: str, schema: dict) -> None: ''' Register a json schema definition :param name: Name of schema :param schema: schema definition, must be json compatible ''' register_configuration( get_caller_module(), dict(name=name, schema=schema), 'json_schema_definition')
def json_schema_definition(name, schema): register_configuration(get_caller_module(), dict(name=name, schema=schema), 'json_schema_definition')