Files
contracts/security/permission.go
T

20 lines
661 B
Go
Raw Normal View History

package security
// Permission is a named bit position (062) representing a single capability.
//
// Applications define their own permission constants using this type:
//
// const (
// Read security.Permission = 0
// Write security.Permission = 1
// Delete security.Permission = 2
// )
//
// Valid positions are 0 through MaxPermission (62). Values outside that range
// are silently ignored by PermissionMask.Has and PermissionMask.Grant.
type Permission int64
// MaxPermission is the highest valid bit position for a Permission constant.
// Bit 63 is reserved for the sign bit of the underlying int64.
const MaxPermission Permission = 62