rbac

package
v0.0.0-...-d125d34 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotChecked        = "not checked"
	ResourceFormatErr = "format error"
	AnonymousUser     = "anonymous user"
	InternalError     = "internal error"
	MemberNotExist    = "member not exist"
	RoleNotExist      = "role not exist"
	AdminAllow        = "admin allows everything"
)

Variables

This section is empty.

Functions

func VisitRoles

func VisitRoles(member *models.Member, role *types.Role,
	attr auth.Attributes) (_ auth.Decision, reason string, err error)

Types

type Authorizer

type Authorizer interface {
	Authorize(ctx context.Context, attributes auth.Attributes) (auth.Decision, string, error)
}

Authorizer use the basic rbac rules to check if the user have the permissions

func NewAuthorizer

func NewAuthorizer(roleservice role.Service, memberservice memberservice.Service) Authorizer

type VisitorFunc

type VisitorFunc func(fmt.Stringer, *types.PolicyRule, error) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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