Search Apps Documentation Source Content File Folder Download Copy Actions Download

acl.gno

0.30 Kb · 21 lines
 1package acl
 2
 3var locked = false
 4var callCount = 0
 5
 6func AdminOnly(cur realm) {
 7	if locked {
 8		panic("unauthorized")
 9	}
10	callCount++
11}
12
13func Lock(cur realm) {
14	if locked {
15		panic("already locked")
16	}
17	locked = true
18}
19
20func GetCallCount() int { return callCount }
21func IsLocked() bool    { return locked }