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
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