Example #1
0
 def get_metadef_object_factory(self, context):
     object_factory = glance.domain.MetadefObjectFactory()
     policy_object_factory = policy.MetadefObjectFactoryProxy(
         object_factory, context, self.policy)
     authorized_object_factory = authorization.MetadefObjectFactoryProxy(
         policy_object_factory, context)
     return authorized_object_factory
Example #2
0
 def get_metadef_object_factory(self, context, authorization_layer=True):
     factory = glance.domain.MetadefObjectFactory()
     if authorization_layer:
         factory = policy.MetadefObjectFactoryProxy(factory, context,
                                                    self.policy)
     factory = glance.notifier.MetadefObjectFactoryProxy(
         factory, context, self.notifier)
     if authorization_layer:
         factory = authorization.MetadefObjectFactoryProxy(factory, context)
     return factory