permissions

package
v1.8.94 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPerm

func BuildPerm(section, group, perm int) int

func FetchBasePermFromPerm

func FetchBasePermFromPerm(perm int) int

FetchBasePermFromPerm returns the base permission number from the permission

func FetchGroupFromPerm

func FetchGroupFromPerm(perm int) int

FetchGroupFromPerm returns the group from the permission

func FetchSectionFromPerm

func FetchSectionFromPerm(perm int) int

FetchSectionFromPerm returns the section from the permission

func HasPerm

func HasPerm(perm int, perms int) bool

func ToBWPart

func ToBWPart(part int) int

ToBWPart returns the bitwise value for the base10 part number

Types

type UserPermissions

type UserPermissions struct {
	// Sections is a number representing the sections that are utilized for this user's permissions
	Sections    int                 `json:"S"`
	Permissions map[int]map[int]int `json:"P"`
}

func NewUserPermissions

func NewUserPermissions(perms ...int) *UserPermissions

func (*UserPermissions) AddPerm

func (up *UserPermissions) AddPerm(fullPerm ...int)

func (*UserPermissions) HasPerm

func (up *UserPermissions) HasPerm(fullPerm int) bool

func (*UserPermissions) RemovePerm

func (up *UserPermissions) RemovePerm(fullPerm int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL