-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
36 lines (31 loc) · 995 Bytes
/
config.js
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
34
35
36
import fs from 'fs';
const path = "../../../plugins/";
const file ="permission.config.js"
fs.access(path, (error) => {
// To check if the given directory
// already exists or not
if (error) {
// If current directory does not exist
// then create it
fs.mkdir(path, (error) => {
if (error) {
console.log(error);
} else {
console.log("New Plugins Directory created successfully !!");
}
});
} else {
}
var buff = `
//Config for default Permissions
// Array of default permissions .
// *** Public Permission hidden in admin Panel
module.exports = {
slug: {
authActions: ["create", "readAny"], // default permissions for Auth User : create | readAny | readOwn | deleteAny | deleteOwn | updateOwn | updateAny
publicActions:["readAny"] // readAny | createAny | deleteAny | updateAny
},
};
`;
fs.writeFileSync(path + file, buff)
});