rbac

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: LGPL-2.1 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// roles defined here
	RoleSuperAdmin = "superadmin"
	RoleAdmin      = "admin"
	RoleUser       = "user"

	// objects defined here
	ObjectAny     = "*"
	ObjectUser    = "user"
	ObjectSession = "session"
	ObjectMemo    = "memo"
)

consts for RBAC

View Source
const (
	ActionAny       = "*"
	ActionReadAll   = "read_all"
	ActionRead      = "read"
	ActionCreateAll = "create_all"
	ActionCreate    = "create"
	ActionUpdateAll = "update_all"
	ActionUpdate    = "update"
	ActionDeleteAll = "delete_all"
	ActionDelete    = "delete"
)

RBAC actions

Variables

View Source
var (
	ErrForbiddenAccess = server.NewHTTPError(http.StatusForbidden, "FORBIDDEN", "You don't have permission to access the requested resource")
	ErrForbiddenAction = server.NewHTTPError(http.StatusForbidden, "FORBIDDEN", "You don't have permission to perform this action")
)

Custom errors

ValidRoles for validation

Functions

func New

func New(enableLog bool) *rbac.RBAC

New returns new RBAC service

Types

This section is empty.

Jump to

Keyboard shortcuts

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