-
Notifications
You must be signed in to change notification settings - Fork 28
/
config.ts
56 lines (55 loc) · 1.95 KB
/
config.ts
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import type { ConfigLoader } from '@balena/pinejs';
import { model as balenaModel } from './src/balena.js';
import {
v6AbstractSqlModel,
getV6Translations,
toVersion as v6ToVersion,
} from './src/translations/v6/v6.js';
import {
v7AbstractSqlModel,
getV7Translations,
toVersion as v7ToVersion,
} from './src/translations/v7/v7.js';
import { getFileUploadHandler } from './src/fileupload-handler.js';
export default {
models: [
balenaModel,
{
apiRoot: 'v7',
modelName: 'v7',
abstractSql: v7AbstractSqlModel,
translateTo: v7ToVersion,
translations: getV7Translations(),
},
{
apiRoot: 'v6',
modelName: 'v6',
abstractSql: v6AbstractSqlModel,
translateTo: v6ToVersion,
translations: getV6Translations(),
},
],
users: [
{
username: 'guest',
password: ' ',
permissions: [
// core model permissions
'resin.cpu_architecture.read',
'resin.device_type.read',
'resin.device_type_alias.read',
'resin.device_family.read',
'resin.device_manufacturer.read',
// public application & hostApp permissions
'resin.application.read?is_public eq true and is_for__device_type/canAccess()',
'resin.release.read?belongs_to__application/any(a:a/is_public eq true and is_for__device_type/canAccess())',
'resin.service.read?application/any(a:a/is_public eq true and is_for__device_type/canAccess())',
`resin.image.read?is_a_build_of__service/any(s:s/application/any(a:a/is_public eq true and is_for__device_type/canAccess()))`,
'resin.application_tag.read?application/any(a:a/is_public eq true and is_for__device_type/canAccess())',
'resin.release_tag.read?release/any(r:r/belongs_to__application/any(a:a/is_public eq true and is_for__device_type/canAccess()))',
`resin.image__is_part_of__release.read?is_part_of__release/any(r:r/belongs_to__application/any(a:a/is_public eq true and is_for__device_type/canAccess()))`,
],
},
],
webResourceHandler: getFileUploadHandler(),
} as ConfigLoader.Config;