@budibase/backend-core 2.32.3 → 2.32.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +52 -27
- package/dist/index.js.map +2 -2
- package/dist/index.js.meta.json +1 -1
- package/dist/package.json +4 -4
- package/dist/plugins.js.meta.json +1 -1
- package/dist/src/security/roles.d.ts +1 -1
- package/dist/src/security/roles.js +7 -7
- package/dist/src/security/roles.js.map +1 -1
- package/package.json +4 -4
- package/src/security/roles.ts +57 -27
package/src/security/roles.ts
CHANGED
|
@@ -48,9 +48,14 @@ export class Role implements RoleDoc {
|
|
|
48
48
|
permissions: Record<string, PermissionLevel[]> = {}
|
|
49
49
|
uiMetadata?: RoleUIMetadata
|
|
50
50
|
|
|
51
|
-
constructor(
|
|
51
|
+
constructor(
|
|
52
|
+
id: string,
|
|
53
|
+
name: string,
|
|
54
|
+
permissionId: string,
|
|
55
|
+
uiMetadata?: RoleUIMetadata
|
|
56
|
+
) {
|
|
52
57
|
this._id = id
|
|
53
|
-
this.name =
|
|
58
|
+
this.name = name
|
|
54
59
|
this.uiMetadata = uiMetadata
|
|
55
60
|
this.permissionId = permissionId
|
|
56
61
|
// version for managing the ID - removing the role_ when responding
|
|
@@ -64,31 +69,56 @@ export class Role implements RoleDoc {
|
|
|
64
69
|
}
|
|
65
70
|
|
|
66
71
|
const BUILTIN_ROLES = {
|
|
67
|
-
ADMIN: new Role(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
72
|
+
ADMIN: new Role(
|
|
73
|
+
BUILTIN_IDS.ADMIN,
|
|
74
|
+
BUILTIN_IDS.ADMIN,
|
|
75
|
+
BuiltinPermissionID.ADMIN,
|
|
76
|
+
{
|
|
77
|
+
displayName: "App admin",
|
|
78
|
+
description: "Can do everything",
|
|
79
|
+
color: RoleColor.ADMIN,
|
|
80
|
+
}
|
|
81
|
+
).addInheritance(BUILTIN_IDS.POWER),
|
|
82
|
+
POWER: new Role(
|
|
83
|
+
BUILTIN_IDS.POWER,
|
|
84
|
+
BUILTIN_IDS.POWER,
|
|
85
|
+
BuiltinPermissionID.POWER,
|
|
86
|
+
{
|
|
87
|
+
displayName: "App power user",
|
|
88
|
+
description: "An app user with more access",
|
|
89
|
+
color: RoleColor.POWER,
|
|
90
|
+
}
|
|
91
|
+
).addInheritance(BUILTIN_IDS.BASIC),
|
|
92
|
+
BASIC: new Role(
|
|
93
|
+
BUILTIN_IDS.BASIC,
|
|
94
|
+
BUILTIN_IDS.BASIC,
|
|
95
|
+
BuiltinPermissionID.WRITE,
|
|
96
|
+
{
|
|
97
|
+
displayName: "App user",
|
|
98
|
+
description: "Any logged in user",
|
|
99
|
+
color: RoleColor.BASIC,
|
|
100
|
+
}
|
|
101
|
+
).addInheritance(BUILTIN_IDS.PUBLIC),
|
|
102
|
+
PUBLIC: new Role(
|
|
103
|
+
BUILTIN_IDS.PUBLIC,
|
|
104
|
+
BUILTIN_IDS.PUBLIC,
|
|
105
|
+
BuiltinPermissionID.PUBLIC,
|
|
106
|
+
{
|
|
107
|
+
displayName: "Public user",
|
|
108
|
+
description: "Accessible to anyone",
|
|
109
|
+
color: RoleColor.PUBLIC,
|
|
110
|
+
}
|
|
111
|
+
),
|
|
112
|
+
BUILDER: new Role(
|
|
113
|
+
BUILTIN_IDS.BUILDER,
|
|
114
|
+
BUILTIN_IDS.BUILDER,
|
|
115
|
+
BuiltinPermissionID.ADMIN,
|
|
116
|
+
{
|
|
117
|
+
displayName: "Builder user",
|
|
118
|
+
description: "Users that can edit this app",
|
|
119
|
+
color: RoleColor.BUILDER,
|
|
120
|
+
}
|
|
121
|
+
),
|
|
92
122
|
}
|
|
93
123
|
|
|
94
124
|
export function getBuiltinRoles(): { [key: string]: RoleDoc } {
|