Пример #1
0
 def allowed(self, request, datum=None):
     try:
         target = {"target.credential.user_id": request.user.id}
         if (api.base.is_service_enabled(request, 'ec2') and
             forms.get_ec2_credentials(request) and
             policy.check((("identity", "identity:ec2_create_credential"),
                           ("identity", "identity:ec2_delete_credential")),
                          request, target=target)):
             return True
     except Exception:
         pass
     return False
Пример #2
0
 def allowed(self, request, datum=None):
     try:
         target = {"target.credential.user_id": request.user.id}
         if (api.base.is_service_enabled(request, 'ec2') and
             forms.get_ec2_credentials(request) and
             policy.check((("identity", "identity:ec2_create_credential"),
                           ("identity", "identity:ec2_delete_credential")),
                          request, target=target)):
             return True
     except Exception:
         pass
     return False