permissions

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2025 License: GPL-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LOG_IF_NONE_FOUND      = true
	DEFAULT_IF_NONE_FOUND  = defaultLog
	DEFAULT_HAS_PERMISSION = false
)

Functions

func HasObjectPermission

func HasObjectPermission(r *http.Request, obj interface{}, perms ...string) bool

HasObjectPermission checks if the given request has the permission to perform the given action on the given object.

func HasPermission

func HasPermission(r *http.Request, perms ...string) bool

HasPermission checks if the given request has the permission to perform the given action.

Types

type PermissionTester

type PermissionTester interface {
	HasObjectPermission(r *http.Request, obj interface{}, perms ...string) bool
	HasPermission(r *http.Request, perms ...string) bool
}
var Tester PermissionTester

Jump to

Keyboard shortcuts

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