mirror of https://github.com/Budibase/budibase.git
16 changed files with 95 additions and 191 deletions
@ -1,75 +1 @@ |
|||
{ |
|||
"levels": [ |
|||
{ |
|||
"name": "owner", |
|||
"permissions": [ |
|||
{ |
|||
"type": "create record", |
|||
"nodeKey": "/customers/1-{id}" |
|||
}, |
|||
{ |
|||
"type": "delete record", |
|||
"nodeKey": "/customers/1-{id}" |
|||
}, |
|||
{ |
|||
"type": "update record", |
|||
"nodeKey": "/customers/1-{id}" |
|||
}, |
|||
{ |
|||
"type": "read record", |
|||
"nodeKey": "/customers/1-{id}" |
|||
}, |
|||
{ |
|||
"type": "create record", |
|||
"nodeKey": "/customers/1-{id}/invoices/2-{id}" |
|||
}, |
|||
{ |
|||
"type": "update record", |
|||
"nodeKey": "/customers/1-{id}/invoices/2-{id}" |
|||
}, |
|||
{ |
|||
"type": "delete record", |
|||
"nodeKey": "/customers/1-{id}/invoices/2-{id}" |
|||
}, |
|||
{ |
|||
"type": "read record", |
|||
"nodeKey": "/customers/1-{id}/invoices/2-{id}" |
|||
}, |
|||
{ |
|||
"type": "write templates" |
|||
}, |
|||
{ |
|||
"type": "create user" |
|||
}, |
|||
{ |
|||
"type": "set password" |
|||
}, |
|||
{ |
|||
"type": "create temporary access" |
|||
}, |
|||
{ |
|||
"type": "enable or disable user" |
|||
}, |
|||
{ |
|||
"type": "write access levels" |
|||
}, |
|||
{ |
|||
"type": "list users" |
|||
}, |
|||
{ |
|||
"type": "list access levels" |
|||
}, |
|||
{ |
|||
"type": "manage index" |
|||
}, |
|||
{ |
|||
"type": "set user access levels" |
|||
}, |
|||
{ |
|||
"type": "manage collection" |
|||
} |
|||
] |
|||
} |
|||
], |
|||
"version": 0 |
|||
} |
|||
{"levels":[{"name":"owner","permissions":[{"type":"create record","nodeKey":"/customers/1-{id}"},{"type":"delete record","nodeKey":"/customers/1-{id}"},{"type":"update record","nodeKey":"/customers/1-{id}"},{"type":"read record","nodeKey":"/customers/1-{id}"},{"type":"create record","nodeKey":"/customers/1-{id}/invoices/2-{id}"},{"type":"update record","nodeKey":"/customers/1-{id}/invoices/2-{id}"},{"type":"delete record","nodeKey":"/customers/1-{id}/invoices/2-{id}"},{"type":"read record","nodeKey":"/customers/1-{id}/invoices/2-{id}"},{"type":"write templates"},{"type":"create user"},{"type":"set password"},{"type":"create temporary access"},{"type":"enable or disable user"},{"type":"write access levels"},{"type":"list users"},{"type":"list access levels"},{"type":"manage index"},{"type":"set user access levels"},{"type":"manage collection"}]}],"version":0} |
|||
@ -1,84 +1 @@ |
|||
{ |
|||
"hierarchy": { |
|||
"name": "root", |
|||
"type": "root", |
|||
"children": [ |
|||
{ |
|||
"name": "customer", |
|||
"type": "record", |
|||
"fields": [ |
|||
{ |
|||
"name": "name", |
|||
"type": "string", |
|||
"typeOptions": { |
|||
"maxLength": 1000, |
|||
"values": null, |
|||
"allowDeclaredValuesOnly": false |
|||
}, |
|||
"label": "name", |
|||
"getInitialValue": "default", |
|||
"getUndefinedValue": "default" |
|||
} |
|||
], |
|||
"children": [ |
|||
{ |
|||
"name": "invoice", |
|||
"type": "record", |
|||
"fields": [ |
|||
{ |
|||
"name": "amount", |
|||
"type": "number", |
|||
"typeOptions": { |
|||
"minValue": 99999999999, |
|||
"maxValue": 99999999999, |
|||
"decimalPlaces": 2 |
|||
}, |
|||
"label": "amount", |
|||
"getInitialValue": "default", |
|||
"getUndefinedValue": "default" |
|||
} |
|||
], |
|||
"children": [], |
|||
"validationRules": [], |
|||
"nodeId": 2, |
|||
"indexes": [], |
|||
"allidsShardFactor": 1, |
|||
"collectionName": "invoices", |
|||
"isSingle": false |
|||
} |
|||
], |
|||
"validationRules": [], |
|||
"nodeId": 1, |
|||
"indexes": [], |
|||
"allidsShardFactor": 64, |
|||
"collectionName": "customers", |
|||
"isSingle": false |
|||
} |
|||
], |
|||
"pathMaps": [], |
|||
"indexes": [], |
|||
"nodeId": 0 |
|||
}, |
|||
"actions": { |
|||
"output_to_file": { |
|||
"name": "output_to_file", |
|||
"behaviourSource": "main", |
|||
"behaviourName": "outputToFile", |
|||
"initialOptions": {} |
|||
} |
|||
}, |
|||
"triggers": [ |
|||
{ |
|||
"actionName": "output_to_file", |
|||
"eventName": "authApi:createUser:onComplete", |
|||
"optionsCreator": "return { filename:'tempaccess' + context.user.name, content:context.result.tempCode };", |
|||
"condition": "!context.password" |
|||
}, |
|||
{ |
|||
"actionName": "output_to_file", |
|||
"eventName": "authApi:createTemporaryAccess:onComplete", |
|||
"optionsCreator": "return { filename:'tempaccess' + context.userName, content:context.result };", |
|||
"condition": "" |
|||
} |
|||
] |
|||
} |
|||
{"hierarchy":{"name":"root","type":"root","children":[{"name":"customer","type":"record","fields":[{"name":"name","type":"string","typeOptions":{"maxLength":1000,"values":null,"allowDeclaredValuesOnly":false},"label":"name","getInitialValue":"default","getUndefinedValue":"default"}],"children":[{"name":"invoiceyooo","type":"record","fields":[{"name":"amount","type":"number","typeOptions":{"minValue":99999999999,"maxValue":99999999999,"decimalPlaces":2},"label":"amount","getInitialValue":"default","getUndefinedValue":"default"}],"children":[],"validationRules":[],"nodeId":2,"indexes":[],"allidsShardFactor":1,"collectionName":"invoices","isSingle":false}],"validationRules":[],"nodeId":1,"indexes":[],"allidsShardFactor":64,"collectionName":"customers","isSingle":false}],"pathMaps":[],"indexes":[],"nodeId":0},"triggers":[{"actionName":"output_to_file","eventName":"authApi:createUser:onComplete","optionsCreator":"return { filename:'tempaccess' + context.user.name, content:context.result.tempCode };","condition":"!context.password"},{"actionName":"output_to_file","eventName":"authApi:createTemporaryAccess:onComplete","optionsCreator":"return { filename:'tempaccess' + context.userName, content:context.result };","condition":""}],"actions":{"output_to_file":[{"name":"output_to_file","behaviourSource":"main","behaviourName":"outputToFile","initialOptions":{}}]}} |
|||
@ -0,0 +1 @@ |
|||
{"levels":[{"name":"owner","permissions":[{"type":"create record","nodeKey":"/customers/1-{id}"},{"type":"delete record","nodeKey":"/customers/1-{id}"},{"type":"update record","nodeKey":"/customers/1-{id}"},{"type":"read record","nodeKey":"/customers/1-{id}"},{"type":"create record","nodeKey":"/customers/1-{id}/invoices/2-{id}"},{"type":"update record","nodeKey":"/customers/1-{id}/invoices/2-{id}"},{"type":"delete record","nodeKey":"/customers/1-{id}/invoices/2-{id}"},{"type":"read record","nodeKey":"/customers/1-{id}/invoices/2-{id}"},{"type":"write templates"},{"type":"create user"},{"type":"set password"},{"type":"create temporary access"},{"type":"enable or disable user"},{"type":"write access levels"},{"type":"list users"},{"type":"list access levels"},{"type":"manage index"},{"type":"set user access levels"},{"type":"manage collection"}]}],"version":0} |
|||
@ -0,0 +1 @@ |
|||
{"hierarchy":{"name":"root","type":"root","children":[{"name":"customer","type":"record","fields":[{"name":"name","type":"string","typeOptions":{"maxLength":1000,"values":null,"allowDeclaredValuesOnly":false},"label":"name","getInitialValue":"default","getUndefinedValue":"default"}],"children":[{"name":"invoiceyooo","type":"record","fields":[{"name":"amount","type":"number","typeOptions":{"minValue":99999999999,"maxValue":99999999999,"decimalPlaces":2},"label":"amount","getInitialValue":"default","getUndefinedValue":"default"}],"children":[],"validationRules":[],"nodeId":2,"indexes":[],"allidsShardFactor":1,"collectionName":"invoices","isSingle":false}],"validationRules":[],"nodeId":1,"indexes":[],"allidsShardFactor":64,"collectionName":"customers","isSingle":false}],"pathMaps":[],"indexes":[],"nodeId":0},"triggers":[{"actionName":"output_to_file","eventName":"authApi:createUser:onComplete","optionsCreator":"return { filename:'tempaccess' + context.user.name, content:context.result.tempCode };","condition":"!context.password"},{"actionName":"output_to_file","eventName":"authApi:createTemporaryAccess:onComplete","optionsCreator":"return { filename:'tempaccess' + context.userName, content:context.result };","condition":""}],"actions":{"undefined":[[[{"name":"output_to_file","behaviourSource":"main","behaviourName":"outputToFile","initialOptions":{}}]]]}} |
|||
@ -0,0 +1,9 @@ |
|||
const fs = require("fs"); |
|||
|
|||
module.exports = (config) => ({ |
|||
main: { |
|||
outputToFile : ({filename, content}) => { |
|||
fs.writeFile(`./tests/.data/${filename}`, content, {encoding:"utf8"}); |
|||
} |
|||
} |
|||
}) |
|||
Loading…
Reference in new issue