mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-01-19 00:27:25 +01:00
A few manager tests
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"heckel.io/ntfy/log"
|
||||
"net/netip"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -97,7 +98,7 @@ type Tier struct {
|
||||
func (t *Tier) Context() log.Context {
|
||||
return log.Context{
|
||||
"tier_id": t.ID,
|
||||
"tier_name": t.Name,
|
||||
"tier_code": t.Code,
|
||||
"stripe_price_id": t.StripePriceID,
|
||||
}
|
||||
}
|
||||
@@ -170,7 +171,7 @@ func NewPermission(read, write bool) Permission {
|
||||
|
||||
// ParsePermission parses the string representation and returns a Permission
|
||||
func ParsePermission(s string) (Permission, error) {
|
||||
switch s {
|
||||
switch strings.ToLower(s) {
|
||||
case "read-write", "rw":
|
||||
return NewPermission(true, true), nil
|
||||
case "read-only", "read", "ro":
|
||||
|
||||
Reference in New Issue
Block a user