def get_metadef_tag_factory(self, context): tag_factory = glance.domain.MetadefTagFactory() policy_tag_factory = policy.MetadefTagFactoryProxy( tag_factory, context, self.policy) authorized_tag_factory = authorization.MetadefTagFactoryProxy( policy_tag_factory, context) return authorized_tag_factory
def get_metadef_tag_factory(self, context, authorization_layer=True): factory = glance.domain.MetadefTagFactory() if authorization_layer: factory = policy.MetadefTagFactoryProxy(factory, context, self.policy) factory = glance.notifier.MetadefTagFactoryProxy( factory, context, self.notifier) if authorization_layer: factory = authorization.MetadefTagFactoryProxy(factory, context) return factory