Example #1
0
 def get_task_factory(self, context):
     task_factory = glance.domain.TaskFactory()
     policy_task_factory = policy.TaskFactoryProxy(task_factory, context,
                                                   self.policy)
     notifier_task_factory = glance.notifier.TaskFactoryProxy(
         policy_task_factory, context, self.notifier)
     authorized_task_factory = authorization.TaskFactoryProxy(
         notifier_task_factory, context)
     return authorized_task_factory
Example #2
0
 def get_task_factory(self, context, authorization_layer=True):
     factory = glance.domain.TaskFactory()
     if authorization_layer:
         factory = policy.TaskFactoryProxy(factory, context, self.policy)
     factory = glance.notifier.TaskFactoryProxy(factory, context,
                                                self.notifier)
     if authorization_layer:
         factory = authorization.TaskFactoryProxy(factory, context)
     return factory