Ejemplo n.º 1
0
 def __init__(self):
     super().__init__()
     instance = Database.getInstance()
     self.db = instance.getConnection()
     self.db.drop_collection("fs.files")
     self.db.drop_collection("fs.chunks")
     self.gfs = gridfs.GridFS(self.db)
Ejemplo n.º 2
0
    def initializeAuthz(self, file):
        with open(file, 'r') as stream:
            try:
                parsed = yaml.safe_load(stream)
                self.__rules = parsed['rules']
                self.__static_rules = parsed['static_rules']
                self.processRoles(parsed['roles'])
            except yaml.YAMLError as exc:
                print(exc)
                sys.exit("Error: Couldn't read authz file.")

        # get db instance
        instance = Database.getInstance()
        self.db = instance.getConnection()
Ejemplo n.º 3
0
 def __init__(self):
         super().__init__()
         instance = Database.getInstance()
         self.db = instance.getConnection()
         self.transaction = instance.getTansaction