Przeglądaj źródła

[libsentry] Mock TListSentryPrivilegesByAuthRequest that is missing

Romain Rigaux 10 lat temu
rodzic
commit
67bcd56132
1 zmienionych plików z 10 dodań i 7 usunięć
  1. 10 7
      desktop/libs/libsentry/src/libsentry/client2.py

+ 10 - 7
desktop/libs/libsentry/src/libsentry/client2.py

@@ -180,10 +180,13 @@ class SentryClient(object):
 
 
   def list_sentry_privileges_by_authorizable(self, authorizableSet, groups=None, roleSet=None):
-    authorizableSet = [TAuthorizable(**authorizable) for authorizable in authorizableSet]
-    if roleSet is not None:
-      roleSet = TSentryActiveRoleSet(**roleSet)
- 
-    request = TListSentryPrivilegesByAuthRequest(requestorUserName=self.username, component=self.component, authorizableSet=authorizableSet, groups=groups, roleSet=roleSet)
-    return self.client.list_sentry_privileges_by_authorizable(request)
-
+#     authorizableSet = [TAuthorizable(**authorizable) for authorizable in authorizableSet]
+#     if roleSet is not None:
+#       roleSet = TSentryActiveRoleSet(**roleSet)
+#  
+#     request = TListSentryPrivilegesByAuthRequest(requestorUserName=self.username, component=self.component, authorizableSet=authorizableSet, groups=groups, roleSet=roleSet)
+#     return self.client.list_sentry_privileges_by_authorizable(request)
+    return type('Response', (object,), {
+        'status': type('Status', (object,), {'value': 0}),
+        'privilegesMapByAuth': {}          
+    })