-
Notifications
You must be signed in to change notification settings - Fork 0
/
perms.go
67 lines (61 loc) · 1.29 KB
/
perms.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package ovpm
import "github.com/cad/ovpm/permset"
// OVPM available permissions.
const (
// User permissions
CreateUserPerm permset.Perm = iota
GetAnyUserPerm
GetSelfPerm
UpdateAnyUserPerm
UpdateSelfPerm
DeleteAnyUserPerm
RenewAnyUserPerm
GenConfigAnyUserPerm
GenConfigSelfPerm
// VPN permissions
GetVPNStatusPerm
InitVPNPerm
UpdateVPNPerm
RestartVPNPerm
// Network permissions
ListNetworksPerm
CreateNetworkPerm
DeleteNetworkPerm
GetNetworkTypesPerm
GetNetworkAssociatedUsersPerm
AssociateNetworkUserPerm
DissociateNetworkUserPerm
)
// AdminPerms returns the list of permissions that admin type user has.
func AdminPerms() []permset.Perm {
return []permset.Perm{
CreateUserPerm,
GetAnyUserPerm,
GetSelfPerm,
UpdateAnyUserPerm,
UpdateSelfPerm,
DeleteAnyUserPerm,
RenewAnyUserPerm,
GenConfigAnyUserPerm,
GenConfigSelfPerm,
GetVPNStatusPerm,
InitVPNPerm,
UpdateVPNPerm,
RestartVPNPerm,
ListNetworksPerm,
CreateNetworkPerm,
DeleteNetworkPerm,
GetNetworkTypesPerm,
GetNetworkAssociatedUsersPerm,
AssociateNetworkUserPerm,
DissociateNetworkUserPerm,
}
}
// UserPerms returns the collection of permissions that the regular users have.
func UserPerms() []permset.Perm {
return []permset.Perm{
GetSelfPerm,
UpdateSelfPerm,
GenConfigSelfPerm,
}
}