Pure package detail
rbac
gno.land/p/gnoswap/rbac
Indexed deployment identity with independently loaded latest RPC source. Functions and Render are realm-only RPC capabilities.
Indexed deployment
Identity
- Package path
- gno.land/p/gnoswap/rbac
- Block
- 192932
- Deployed (UTC)
- Transaction
- Kxi9IZS3xadFO22yoS7SW9zVA4NfcEDRh/eNtfJV2gw=
Latest RPC state
Source
package rbac
const zeroAddress = address("")
// Role represents a role with a name and an assigned address.
type Role struct {
// name represents the role's identifier
name string
address address
}
// NewRole creates a new Role instance with roleName.
func NewRole(roleName string, addr address) *Role {
return &Role{
name: roleName,
address: addr,
}
}
// Name returns the role's name.
func (r *Role) Name() string { return r.name }
// Address returns the address assigned to this role. Returns empty address if no address is assigned.
func (r *Role) Address() address {
return r.address
}
// IsEmpty returns true if no address is assigned to this role.
func (r *Role) IsEmpty() bool {
return r.Address() == zeroAddress
}
// IsAuthorized returns true if addr matches the role's assigned address.
func (r *Role) IsAuthorized(addr address) bool {
return r.Address() == addr
}
// setAddress assigns addr to this role.
func (r *Role) setAddress(addr address) {
r.address = addr
}
The verified vm/qfuncs operation accepts realm paths only.
Pure packages expose source files but do not have Realm Render.