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