acl

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 2, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PermView      = acl.PermView
	PermCreate    = acl.PermCreate
	PermUpdate    = acl.PermUpdate
	PermDelete    = acl.PermDelete
	PermList      = acl.PermList
	PermAuthCross = acl.PermAuthCross
	PermCount     = acl.PermCount
	PermApprove   = acl.PermApprove
	PermReject    = acl.PermReject
	PermGet       = acl.PermGet
	PermSet       = acl.PermSet
	PermRun       = `run`
	PermPause     = `pause`
)

The permission list

Variables

View Source
var ErrNoPermissions = acl.ErrNoPermissions

Functions

func HasPermission

func HasPermission(ctx context.Context, permissions ...string) bool

HasPermission returns `true` if the `user` have all permissions from the list (without custom check)

func HaveAccessApprove

func HaveAccessApprove(ctx context.Context, obj any) bool

HaveAccessApprove of the object returns `true` if user can approve the object

func HaveAccessCount

func HaveAccessCount(ctx context.Context, obj any) bool

HaveAccessCount of the object returns `true` if user can count the object

func HaveAccessCreate

func HaveAccessCreate(ctx context.Context, obj any) bool

HaveAccessCreate of the object returns `true` if user can create this type of object

func HaveAccessDelete

func HaveAccessDelete(ctx context.Context, obj any) bool

HaveAccessDelete of the object returns `true` if user can delite the object

func HaveAccessGet

func HaveAccessGet(ctx context.Context, obj any) bool

HaveAccessGet of the object returns `true` if user can get the object

func HaveAccessList

func HaveAccessList(ctx context.Context, obj any) bool

HaveAccessList to the object returns `true` if user can read list of the object

func HaveAccessPause

func HaveAccessPause(ctx context.Context, obj any) bool

HaveAccessPause of the object returns `true` if user can pause the object

func HaveAccessReject

func HaveAccessReject(ctx context.Context, obj any) bool

HaveAccessReject of the object returns `true` if user can reject the object

func HaveAccessRun

func HaveAccessRun(ctx context.Context, obj any) bool

HaveAccessRun of the object returns `true` if user can run the object

func HaveAccessSet

func HaveAccessSet(ctx context.Context, obj any) bool

HaveAccessSet of the object returns `true` if user can set the object

func HaveAccessUpdate

func HaveAccessUpdate(ctx context.Context, obj any) bool

HaveAccessUpdate of the object returns `true` if user can update the object

func HaveAccessView

func HaveAccessView(ctx context.Context, obj any) bool

HaveAccessView to the object returns `true` if user can read of the object

func HaveAccountLink(ctx context.Context, obj any) bool

HaveAccountLink of the object to the current account

func HaveObjectPermissions

func HaveObjectPermissions(ctx context.Context, obj any, permissions ...string) bool

HaveObjectPermissions returns `true` if the `user` have all permissions from the list for the object

func HavePermissions

func HavePermissions(ctx context.Context, permissions ...string) bool

HavePermissions returns `true` if the `user` have all permissions from the list

func InitModelPermissions

func InitModelPermissions(pm *permissions.Manager, models ...any)

InitModelPermissions for particular models

func InitModelPermissionsWithCustomCheck

func InitModelPermissionsWithCustomCheck(pm *permissions.Manager, customCheck checkFnk, models ...any)

InitModelPermissionsWithCustomCheck for particular models and extra custom check function

func IsNoPermCheck

func IsNoPermCheck(ctx context.Context) bool

IsNoPermCheck returns `true` if the permission check is disabled

func WithNoPermCheck

func WithNoPermCheck(ctx context.Context) context.Context

WithNoPermCheck returns new context with disabled permission check

Types

type ACLError

type ACLError = acl.ACLError

type RBACType

type RBACType = acl.RBACType

Jump to

Keyboard shortcuts

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