dao

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCircularReference = errors.New("sha.rbac: circular reference")
View Source
var LogReadOperation bool

Functions

func CancelRole

func CancelRole(ctx context.Context, role string, subID int64)

func CreatePermIfNotExists

func CreatePermIfNotExists(name string) string

func DelPerm

func DelPerm(ctx context.Context, name string)

func DelRole

func DelRole(ctx context.Context, name string)

func GetAllBasedRoleIDs

func GetAllBasedRoleIDs(ctx context.Context, roleID int64) map[int64]struct{}

func GetPermIDByName

func GetPermIDByName(ctx context.Context, name string) (int64, error)

func GetRoleIDByName

func GetRoleIDByName(ctx context.Context, name string) (int64, error)

func GrantRole

func GrantRole(ctx context.Context, role string, subID int64)

func MustGetPermIDByName

func MustGetPermIDByName(ctx context.Context, name string) int64

func MustGetRoleIDByName

func MustGetRoleIDByName(ctx context.Context, name string) int64

func NewPerm

func NewPerm(ctx context.Context, name, desc string)

func NewRole

func NewRole(ctx context.Context, name, desc string)

func Perms

func Perms(ctx context.Context) []*model.Permission

func RoleAddPerm

func RoleAddPerm(ctx context.Context, role, perm string)

func RoleByName

func RoleByName(ctx context.Context, name string) *model.Role

func RoleDelPerm

func RoleDelPerm(ctx context.Context, role, perm string)

func RoleGetBasedByID

func RoleGetBasedByID(ctx context.Context, roleID int64) []int64

func RoleInheritFrom

func RoleInheritFrom(ctx context.Context, role, base string) error

func RolePermIDs

func RolePermIDs(ctx context.Context, roleID int64) []int64

func RolePerms

func RolePerms(ctx context.Context, roleID int64) []*model.Permission

func RoleUninheritFrom

func RoleUninheritFrom(ctx context.Context, role, base string)

func Roles

func Roles(ctx context.Context) []*model.Role

func SubjectRoles

func SubjectRoles(ctx context.Context, subject auth.Subject) []int64

Types

This section is empty.

Jump to

Keyboard shortcuts

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