Example #1
0
 def get_metadef_resource_type_factory(self, context):
     resource_type_factory = glance.domain.MetadefResourceTypeFactory()
     policy_resource_type_factory = policy.MetadefResourceTypeFactoryProxy(
         resource_type_factory, context, self.policy)
     authorized_resource_type_factory = \
         authorization.MetadefResourceTypeFactoryProxy(
             policy_resource_type_factory, context)
     return authorized_resource_type_factory
Example #2
0
 def get_metadef_resource_type_factory(self,
                                       context,
                                       authorization_layer=True):
     factory = glance.domain.MetadefResourceTypeFactory()
     if authorization_layer:
         factory = policy.MetadefResourceTypeFactoryProxy(
             factory, context, self.policy)
     factory = glance.notifier.MetadefResourceTypeFactoryProxy(
         factory, context, self.notifier)
     if authorization_layer:
         factory = authorization.MetadefResourceTypeFactoryProxy(
             factory, context)
     return factory