permissions

package
v0.19.1237 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 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

func Object added in v0.19.1149

func Object(orgID string, kind ResourceKind, id string) string

Object is the grant key for a resource-scoped permission: "<orgID>:<kind>/<id>". Exactly two levels, so the parent fallback lands on the org.

func StackObject added in v0.19.1149

func StackObject(orgID, installID string) string

StackObject keeps the key shape already minted into stack role rows.

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 ResourceKind added in v0.19.1149

type ResourceKind string
const (
	KindApp     ResourceKind = "app"
	KindInstall ResourceKind = "install"
	KindStack   ResourceKind = "stack"
)

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