roleservice

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppLike added in v0.0.5

type AppLike interface {
	DB() app.DBClient
	Roles() []*app.Role
	Key() string
	UpdateCache() error
	Resources() *app.ResourcesManager
}

type RoleService

type RoleService struct {
	DB          func() app.DBClient
	Roles       func() []*app.Role
	AppKey      func() string
	UpdateCache func() error
	Resources   func() *app.ResourcesManager
}

func New added in v0.0.5

func New(app AppLike) *RoleService

func (*RoleService) Authorize

func (rs *RoleService) Authorize(c app.Context) error

func (*RoleService) Create

func (rs *RoleService) Create(c app.Context, _ *any) (*app.Role, error)

func (*RoleService) Delete

func (rs *RoleService) Delete(c app.Context, _ *any) (any, error)

func (*RoleService) Detail

func (rs *RoleService) Detail(c app.Context, _ *any) (*schema.Entity, error)

func (*RoleService) GetPermission added in v0.0.5

func (rs *RoleService) GetPermission(roleID uint64, action string) *app.Permission

func (*RoleService) GetRolesFromIDs added in v0.0.5

func (rs *RoleService) GetRolesFromIDs(ids []uint64) []*app.Role

func (*RoleService) List

func (rs *RoleService) List(c app.Context, _ *any) ([]*schema.Entity, error)

func (*RoleService) ParseUser

func (rs *RoleService) ParseUser(c app.Context) error

func (*RoleService) ResourcesList added in v0.0.5

func (rs *RoleService) ResourcesList(c app.Context, _ *any) ([]*app.Resource, error)

func (*RoleService) Update

func (rs *RoleService) Update(c app.Context, _ *any) (_ *app.Role, err error)

Jump to

Keyboard shortcuts

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