This commit is contained in:
Jabberwocky238
2026-07-15 11:06:48 -04:00
commit c746f88bbe
69 changed files with 14975 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
package common
type Perm string
const (
PermRead Perm = "read"
PermWrite Perm = "write"
PermAdmin Perm = "admin"
)
// PermRank gives perm a hierarchy for implication checks: a grant of rank N
// satisfies a request of rank <= N.
func (perm Perm) PermRank() int {
switch perm {
case PermAdmin:
return 3
case PermWrite:
return 2
default:
return 1
}
}