Exemple #1
0
 def get_new_created_item_in_vault_by_name(self,itemname, vaultid):
     query = "select id,status from ss_objects where groupid = {} and objectname='{}'".format(vaultid, itemname)
     res =  self.db_exec.execute_query(query)
     for row in res:
         stat=obj_status(row[1])
         if stat.is_active():
             return row[0]
     return False
Exemple #2
0
 def number_of_admins(self,vaultid):
     query = "select status from ss_groupkeys where groupid = {}".format(vaultid)
     res = self.db_exec.execute_query(query)
     admins=0
     for row in res:
         if obj_status(row[0]).has_admin():
             admins+=1
     return admins
Exemple #3
0
 def count_objects_in_vault(self, vaultid):
     query = "select id,status from ss_objects where groupid = {}".format(vaultid)
     res = self.db_exec.execute_query(query)
     objs = 0
     for row in res:
         stat = obj_status(row[1])
         if stat.is_active():
             objs+=1
     return objs
Exemple #4
0
 def number_of_admins(self, vaultid):
     query = "select status from ss_groupkeys where groupid = {}".format(
         vaultid)
     res = self.db_exec.execute_query(query)
     admins = 0
     for row in res:
         if obj_status(row[0]).has_admin():
             admins += 1
     return admins
Exemple #5
0
 def get_new_created_item_in_vault_by_name(self, itemname, vaultid):
     query = "select id,status from ss_objects where groupid = {} and objectname='{}'".format(
         vaultid, itemname)
     res = self.db_exec.execute_query(query)
     for row in res:
         stat = obj_status(row[1])
         if stat.is_active():
             return row[0]
     return False
Exemple #6
0
 def get_all_objects_in_vault(self,vaultid):
     query = "select id,objectname,status from ss_objects where groupid={}".format(vaultid)
     objs=[]
     res = self.db_exec.execute_query(query)
     for row in res:
         if obj_status(row[2]).is_active():
             objs.append([row[0],row[1]])
     if not objs:
         return False
     return objs
Exemple #7
0
 def count_objects_in_vault(self, vaultid):
     query = "select id,status from ss_objects where groupid = {}".format(
         vaultid)
     res = self.db_exec.execute_query(query)
     objs = 0
     for row in res:
         stat = obj_status(row[1])
         if stat.is_active():
             objs += 1
     return objs
Exemple #8
0
 def get_all_objects_in_vault(self, vaultid):
     query = "select id,objectname,status from ss_objects where groupid={}".format(
         vaultid)
     objs = []
     res = self.db_exec.execute_query(query)
     for row in res:
         if obj_status(row[2]).is_active():
             objs.append([row[0], row[1]])
     if not objs:
         return False
     return objs
Exemple #9
0
 def get_user_vault_membership(self,userid,vaultid):
     query = 'select status from ss_groupkeys where userid ={} && groupid ={}'.format(userid,vaultid)
     return obj_status(self.db_exec.execute_query(query)[0][0])
Exemple #10
0
 def get_user_vault_membership(self, userid, vaultid):
     query = 'select status from ss_groupkeys where userid ={} && groupid ={}'.format(
         userid, vaultid)
     return obj_status(self.db_exec.execute_query(query)[0][0])