-
Notifications
You must be signed in to change notification settings - Fork 2
/
role.go
77 lines (58 loc) · 1.19 KB
/
role.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
68
69
70
71
72
73
74
75
76
77
package raiden
import (
"github.com/sev-2/raiden/pkg/supabase/objects"
)
// TODO : support organizational unit roles
type (
Role interface {
// name
Name() string
// default 60
ConnectionLimit() int
// default true
InheritRole() bool
// Disable for now, because need super user role for set it
// // default false
// IsReplicationRole() bool
// // default false
// IsSuperuser() bool
// default false
CanBypassRls() bool
// default false
CanCreateDB() bool
// default false
CanCreateRole() bool
// default false
CanLogin() bool
// default nil
ValidUntil() *objects.SupabaseTime
}
RoleBase struct {
}
)
const (
DefaultRoleValidUntilLayout = "2006-01-02"
DefaultRoleConnectionLimit = 60
)
// ----- Base Role Default Func -----
func (r *RoleBase) ConnectionLimit() int {
return DefaultRoleConnectionLimit
}
func (r *RoleBase) InheritRole() bool {
return true
}
func (r *RoleBase) CanBypassRls() bool {
return false
}
func (r *RoleBase) CanCreateDB() bool {
return false
}
func (r *RoleBase) CanCreateRole() bool {
return false
}
func (r *RoleBase) CanLogin() bool {
return false
}
func (r *RoleBase) ValidUntil() *objects.SupabaseTime {
return nil
}