-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.js
More file actions
33 lines (29 loc) · 1018 Bytes
/
config.js
File metadata and controls
33 lines (29 loc) · 1018 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
module.exports = {
whiteList : ["ompatil","mayurhiwale","mayur"],
authKey : process.env.AUTH_KEY,
subjects : {
bis: "Business Intelligence System",
cns: "Cryptography Network Security",
dt: "Design Thinking",
nlp: "Natural Language Processing",
misc: "Miscellaneous"
},
fileDeleteDelay : 30 * 60, // 30 minutes
hasAccess: function(authKey,username) {
console.log(this.authKey);
if(authKey !== this.authKey) return false;
if(!this.whiteList.includes(Tools.toId(username))) return false;
return true;
},
parseFilePath: function(subject,number,type) {
let path = `./documents/${subject}/${subject + number}`;
type = type.toLowerCase();
switch(type.charAt(0)) {
case 'e' : path += "exp" + type.replace("experiment","");
break;
case 'q' : path += "qb" + type.replace("questionbank","");
break;
}
return path;
}
}