permmanager

package
v0.0.0-...-c4fc964 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Username      string
	UserID        int64
	UserIDStr     string
	GroupID       int64
	GroupIDStr    string
	Route         string
	UserHaveGroup bool
}

type PermManager

type PermManager struct {
	*casbin.Enforcer
	Context
}

func (*PermManager) AddPoliciesForGroup

func (p *PermManager) AddPoliciesForGroup(route string, newActions ...string) error

func (*PermManager) AddPoliciesForGroupHere

func (p *PermManager) AddPoliciesForGroupHere(newActions ...string) error

add actions for user at the current route.

func (*PermManager) AddPoliciesForUser

func (p *PermManager) AddPoliciesForUser(route string, newActions ...string) error

func (*PermManager) AddPoliciesForUserHere

func (p *PermManager) AddPoliciesForUserHere(newActions ...string) error

add actions for user at the current route.

func (*PermManager) UserDerivePolicesFromGroup

func (p *PermManager) UserDerivePolicesFromGroup(groupID string) error

Jump to

Keyboard shortcuts

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