Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

permission_registry state

Back to all declarations

MaxResources

untyped bigint

Value

(1000 <untyped> bigint)

MaxResourcesPerAdmin

untyped bigint

Value

(20 <untyped> bigint)

MaxPermissionsPerResource

untyped bigint

Value

(50 <untyped> bigint)

MaxHoldersPerPermission

untyped bigint

Value

(200 <untyped> bigint)

MaxNameLen

untyped bigint

Value

(64 <untyped> bigint)

ReservationPeriod

int64

// 90 days

Value

7776000

MaxRenderResources

untyped bigint

Value

(20 <untyped> bigint)

MaxRenderPermissions

untyped bigint

Value

(8 <untyped> bigint)

MaxRenderHolders

untyped bigint

Value

(10 <untyped> bigint)

Reservation

type

Reservation holds a deleted resource name for its former admin AND its original creator, and expires.

Value

permission_registry.Reservation

resources

map[string].uverse.address

resources maps a resource name to the admin address that controls it.

Open
OID
0243ed…b7fa:31
resources details

Inspect map

resourceNames

[]string (len=2)

resourceNames tracks the insertion-ordered list of resource names so ListResources can iterate without scanning the map.

Open
OID
0243ed…b7fa:44
resourceNames details (len=2)

+2 more Inspect slice

permissions

map[string]map[string]map[.uverse.address]bool

permissions maps resource -> permission -> address -> granted. Three-level nesting gives O(1) lookup for Has().

Open
OID
0243ed…b7fa:33
permissions details

Inspect map

permList

map[string][]string

permList tracks the ordered list of distinct permission names per resource, so GetPermissions can iterate without scanning the full map.

Open
OID
0243ed…b7fa:34
permList details

Inspect map

retired

map[string]*permission_registry.Reservation

retired maps a deleted resource name to its time-bounded reservation. Consumers authorize against resource names, so a freed name must not be claimable by an attacker while integrators may still reference it — but the hold expires so tombstones cannot lock the namespace forever.

Open
OID
0243ed…b7fa:35
retired details

Inspect map

resourceCreators

map[string].uverse.address

resourceCreators records each resource's ORIGINAL creator, immutable through admin transfers, so a hostile admin-transferee cannot permanently strand a name against the project that made it.

Open
OID
0243ed…b7fa:36
resourceCreators details

Inspect map

adminResources

map[.uverse.address]int

adminResources counts the live resources each address administers, so MaxResourcesPerAdmin can be enforced in O(1). Entries are removed when the count reaches zero so the map tracks live admins only (R1).

Open
OID
0243ed…b7fa:37
adminResources details

Inspect map

pendingAdmins

map[string].uverse.address

pendingAdmins holds nominated-but-not-yet-accepted admins, keyed by resource name. Admin handoff is two-step (Y4): nominating is reversible, only the nominee's own acceptance is final.

Open
OID
0243ed…b7fa:38
pendingAdmins details

Inspect map

mustBeAdmin

func(who .uverse.address, resource string)

mustBeAdmin panics if who is not the admin of the resource. Y1 (audit 2026-09-21): identity is now passed in from the crossing entrypoint's own \`cur.Previous().Address()\` rather than recomputed by a non-crossing helper via unsafe.PreviousRealm(). The stack-walking form returned the correct address on every path this realm actually exposes, but nothing in the type system tied it to the immediate caller — a future non-crossing exported helper calling it would have silently resolved its importer's caller instead of its importer (security.md Class 2). Threading \`cur\` makes the binding structural.

Open
OID
0243ed…b7fa:13
mustBeAdmin details

Inspect func

rejectStraySend

func()

rejectStraySend aborts a transaction that attaches coins. This realm has no banker, no payable path and no withdrawal function, so coins attached to any entrypoint would be permanently stranded at the realm address (Y5, security.md § operational).

Open
OID
0243ed…b7fa:14
rejectStraySend details

Inspect func

releaseAdminSlot

func(a .uverse.address)

releaseAdminSlot decrements an admin's live-resource count, deleting the entry when it reaches zero so adminResources never accumulates zero-valued keys.

Open
OID
0243ed…b7fa:15
releaseAdminSlot details

Inspect func

isValidName

func(name string) bool

isValidName restricts resource and permission names to lowercase alphanumeric with underscores. Beyond hygiene this is a security property: names appear in composite trust decisions and rendered output, so no delimiter or markdown character may enter one.

Open
OID
0243ed…b7fa:16
isValidName details

Inspect func

nameRuleText

func(kind string) string
Open
OID
0243ed…b7fa:17
nameRuleText details

Inspect func

CreateResource

func(resourceName string)

CreateResource registers a new named resource. The caller becomes its admin and is the only address that can grant or revoke permissions on it. A deleted resource name stays reserved for its former admin and its original creator until the reservation expires. Each address may administer at most MaxResourcesPerAdmin resources at once, and the registry holds at most MaxResources in total.

Open
OID
0243ed…b7fa:18
CreateResource details

Inspect func

DeleteResource

func(resourceName string)

DeleteResource removes a resource and every permission under it. Only the resource admin can call this. The name stays reserved for the caller and for the original creator: nobody else can re-create it and inherit its consumers until the reservation expires.

Open
OID
0243ed…b7fa:19
DeleteResource details

Inspect func

Grant

func(resourceName string, permission string, addr .uverse.address)

Grant gives an address a named permission on a resource. Only the resource admin can call this. Panics if the permission is already granted to avoid silent no-ops.

Open
OID
0243ed…b7fa:20
Grant details

Inspect func

Revoke

func(resourceName string, permission string, addr .uverse.address)

Revoke removes a permission from an address. Only the resource admin can call this. Panics if the permission was not granted. A permission left with no holders is pruned from the resource's permission list.

Open
OID
0243ed…b7fa:21
Revoke details

Inspect func

TransferAdmin

func(resourceName string, newAdmin .uverse.address)

TransferAdmin nominates a new admin for a resource. Only the current admin can call this, and the handoff does NOT take effect until the nominee calls AcceptAdmin. Y4 (audit 2026-09-21): the upstream one-step transfer made a well-formed-but-unowned destination permanently fatal. address.IsValid only checks bech32 form, so a mistyped address passed the check and left the resource with an admin nobody controls — it could never again be granted on, revoked from, transferred or deleted, and its slot was lost from both the global cap and the former admin's quota forever. Nomination is reversible; only the nominee's consent is final.

Open
OID
0243ed…b7fa:22
TransferAdmin details

Inspect func

CancelAdminTransfer

func(resourceName string)

CancelAdminTransfer withdraws a pending nomination. Only the current admin can call this.

Open
OID
0243ed…b7fa:23
CancelAdminTransfer details

Inspect func

AcceptAdmin

func(resourceName string)

AcceptAdmin completes a pending handoff; only the nominee may call it. The nominee's quota is checked HERE — at consent time — so a nomination can never push an account past MaxResourcesPerAdmin without that account agreeing to carry the resource.

Open
OID
0243ed…b7fa:24
AcceptAdmin details

Inspect func

Has

func(resourceName string, permission string, addr .uverse.address) bool

Has returns true if addr holds the named permission on the resource. Returns false (never panics) for unknown resources or permissions. INTEGRATOR CONTRACT (Y7): Has takes the subject address explicitly and performs NO caller authentication — it answers "does this address hold this permission", not "may my caller do this". A consuming realm must derive addr from its own crossing entrypoint's cur.Previous().Address() and pass it in. Deriving it inside a non-crossing helper via unsafe.PreviousRealm() resolves the consumer's own caller's caller and is a Class-2 designation-forgery bug in the consumer.

Open
OID
0243ed…b7fa:25
Has details

Inspect func

GetPermissions

func(resourceName string, addr .uverse.address) string

GetPermissions returns all permission names granted to addr on a resource, as a comma-separated string. Returns "none" if the address has no permissions.

Open
OID
0243ed…b7fa:26
GetPermissions details

Inspect func

ListResources

func() string

ListResources returns all registered resource names as a comma-separated string in registration order. Returns "none" if no resources exist.

Open
OID
0243ed…b7fa:27
ListResources details

Inspect func

GetAdmin

func(resourceName string) string

GetAdmin returns the admin address of a resource.

Open
OID
0243ed…b7fa:28
GetAdmin details

Inspect func

GetPendingAdmin

func(resourceName string) string

GetPendingAdmin returns the nominated admin awaiting acceptance for a resource, or "none".

Open
OID
0243ed…b7fa:29
GetPendingAdmin details

Inspect func

Render

func(path string) string

Render returns a markdown overview. Never panics. Output is bounded by MaxRenderResources / MaxRenderPermissions / MaxRenderHolders (Y3); truncated sections name the query to use for complete data.

Open
OID
0243ed…b7fa:30
Render details

Inspect func
MaxResources : untyped bigint =(1000 <untyped> bigint)
MaxResourcesPerAdmin : untyped bigint =(20 <untyped> bigint)
MaxPermissionsPerResource : untyped bigint =(50 <untyped> bigint)
MaxHoldersPerPermission : untyped bigint =(200 <untyped> bigint)
MaxNameLen : untyped bigint =(64 <untyped> bigint)
ReservationPeriod : int64 =7776000
MaxRenderResources : untyped bigint =(20 <untyped> bigint)
MaxRenderPermissions : untyped bigint =(8 <untyped> bigint)
MaxRenderHolders : untyped bigint =(10 <untyped> bigint)
Reservation : type =permission_registry.Reservation
resources : map[string].uverse.address Inspect
resourceNames : []string (len=2) Inspect
permissions : map[string]map[string]map[.uverse.address]bool Inspect
permList : map[string][]string Inspect
retired : map[string]*permission_registry.Reservation Inspect
resourceCreators : map[string].uverse.address Inspect
adminResources : map[.uverse.address]int Inspect
pendingAdmins : map[string].uverse.address Inspect
init.18 : func() Inspect
mustBeAdmin : func(who .uverse.address, resource string) Inspect
rejectStraySend : func() Inspect
releaseAdminSlot : func(a .uverse.address) Inspect
isValidName : func(name string) bool Inspect
nameRuleText : func(kind string) string Inspect
CreateResource : func(resourceName string) Inspect
DeleteResource : func(resourceName string) Inspect
Grant : func(resourceName string, permission string, addr .uverse.address) Inspect
Revoke : func(resourceName string, permission string, addr .uverse.address) Inspect
TransferAdmin : func(resourceName string, newAdmin .uverse.address) Inspect
CancelAdminTransfer : func(resourceName string) Inspect
AcceptAdmin : func(resourceName string) Inspect
Has : func(resourceName string, permission string, addr .uverse.address) bool Inspect
GetPermissions : func(resourceName string, addr .uverse.address) string Inspect
ListResources : func() string Inspect
GetAdmin : func(resourceName string) string Inspect
GetPendingAdmin : func(resourceName string) string Inspect
Render : func(path string) string Inspect