-
Notifications
You must be signed in to change notification settings - Fork 3
/
authentication.go
60 lines (50 loc) · 2.62 KB
/
authentication.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
package btcpay
import "fmt"
// Enums BTCPayPermission
type BTCPayPermission string
type Permission struct {
Unrestricted BTCPayPermission
UserCanviewprofile BTCPayPermission
UserCanmodifyprofile BTCPayPermission
UserCanmanagenotificationsforuser BTCPayPermission
UserCanviewnotificationsforuser BTCPayPermission
ServerCancreateuser BTCPayPermission
ServerCanmodifyserversettings BTCPayPermission
ServerCanuseinternallightningnode BTCPayPermission
ServerCancreatelightninginvoiceinternalnode BTCPayPermission
StoreCanmodifystoresettings BTCPayPermission
StoreWebhooksCanmodifywebhooks BTCPayPermission
StoreCanviewstoresettings BTCPayPermission
StoreCancreateinvoice BTCPayPermission
StoreCanviewinvoices BTCPayPermission
StoreCanmodifypaymentrequests BTCPayPermission
StoreCanviewpaymentrequests BTCPayPermission
StoreCanuselightningnode BTCPayPermission
StoreCancreatelightninginvoice BTCPayPermission
CustomPermission BTCPayPermission
}
func GetPermission() *Permission {
return &Permission{
Unrestricted: "unrestricted",
UserCanviewprofile: "btcpay.user.canviewprofile",
UserCanmodifyprofile: "btcpay.user.canmodifyprofile",
UserCanmanagenotificationsforuser: "btcpay.user.canmanagenotificationsforuser",
UserCanviewnotificationsforuser: "btcpay.user.canviewnotificationsforuser",
ServerCancreateuser: "btcpay.server.cancreateuser",
ServerCanmodifyserversettings: "btcpay.server.canmodifyserversettings",
ServerCanuseinternallightningnode: "btcpay.server.canuseinternallightningnode",
ServerCancreatelightninginvoiceinternalnode: "btcpay.server.cancreatelightninginvoiceinternalnode",
StoreCanmodifystoresettings: "btcpay.store.canmodifystoresettings",
StoreWebhooksCanmodifywebhooks: "btcpay.store.webhooks.canmodifywebhooks",
StoreCanviewstoresettings: "btcpay.store.canviewstoresettings",
StoreCancreateinvoice: "btcpay.store.cancreateinvoice",
StoreCanviewinvoices: "btcpay.store.canviewinvoices",
StoreCanmodifypaymentrequests: "btcpay.store.canmodifypaymentrequests",
StoreCanviewpaymentrequests: "btcpay.store.canviewpaymentrequests",
StoreCanuselightningnode: "btcpay.store.canuselightningnode",
StoreCancreatelightninginvoice: "btcpay.store.cancreatelightninginvoice",
}
}
func CreateCustomPermission(permission BTCPayPermission, storeID StoreID) BTCPayPermission {
return BTCPayPermission(fmt.Sprintf("%s:%s", permission, storeID))
}