20 lines
661 B
Go
20 lines
661 B
Go
|
|
package security
|
|||
|
|
|
|||
|
|
// Permission is a named bit position (0–62) 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
|