-
Notifications
You must be signed in to change notification settings - Fork 90
/
rbac.go
53 lines (46 loc) · 1.05 KB
/
rbac.go
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
package rbac
import (
"github.com/replicatedhq/kots/pkg/rbac/types"
)
const (
ClusterAdminRoleID = "cluster-admin"
)
var (
ClusterAdminRole = types.Role{
ID: "cluster-admin",
Name: "Cluster Admin",
Description: "Read/write access to all resources",
Allow: []types.Policy{PolicyAllowAll},
}
SupportRole = types.Role{
ID: "support",
Name: "Support",
Description: "Role for support personnel",
Allow: []types.Policy{
PolicyReadonly,
{Action: "**", Resource: "preflight.*"},
{Action: "**", Resource: "**.preflight.*"},
{Action: "**", Resource: "supportbundle.*"},
{Action: "**", Resource: "**.supportbundle.*"},
},
Deny: []types.Policy{
{Action: "**", Resource: "app.*.downstream.filetree."},
},
}
PolicyAllowAll = types.Policy{
Name: "Allow All",
Action: "**",
Resource: "**",
}
PolicyReadonly = types.Policy{
Name: "Read Only",
Action: "read",
Resource: "**",
}
)
func DefaultRoles() []types.Role {
return []types.Role{
ClusterAdminRole,
SupportRole,
}
}