permissions

package
v0.19.913 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSet

func NewSet() map[string]Permission

Types

type NoAccessError

type NoAccessError struct {
	Permission Permission
	ObjectID   string
}

func (NoAccessError) Error

func (n NoAccessError) Error() string

type Permission

type Permission string
const (
	PermissionUnknown Permission = "unknown"

	PermissionAll    Permission = "all"
	PermissionCreate Permission = "create"
	PermissionRead   Permission = "read"
	PermissionUpdate Permission = "update"
	PermissionDelete Permission = "delete"
)

func FromRequest

func FromRequest(ctx *gin.Context) Permission

func NewPermission

func NewPermission(val string) (Permission, error)

func (Permission) ToStrPtr

func (p Permission) ToStrPtr() *string

type Set

type Set map[string]Permission

func (Set) Add

func (p Set) Add(set map[string]*string) error

func (Set) CanPerform

func (p Set) CanPerform(obj string, perm Permission) error

Jump to

Keyboard shortcuts

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