roleservice

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: MIT Imports: 9 Imported by: 1

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() db.Client
	Roles() []*fs.Role
	Key() string
	UpdateCache(ctx context.Context) error
	Resources() *fs.ResourcesManager
}

type RoleService

type RoleService struct {
	DB          func() db.Client
	Roles       func() []*fs.Role
	AppKey      func() string
	UpdateCache func(context.Context) error
	Resources   func() *fs.ResourcesManager
}

func New added in v0.0.5

func New(app AppLike) *RoleService

func (*RoleService) Authorize

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

func (*RoleService) Create

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

func (*RoleService) Delete

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

func (*RoleService) Detail

func (rs *RoleService) Detail(c fs.Context, _ any) (*fs.Role, error)

func (*RoleService) GetPermission added in v0.0.5

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

func (*RoleService) GetRolesFromIDs added in v0.0.5

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

func (*RoleService) List

func (rs *RoleService) List(c fs.Context, _ any) ([]*fs.Role, error)

func (*RoleService) ParseUser

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

func (*RoleService) ResourcesList added in v0.0.5

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

func (*RoleService) Update

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

Jump to

Keyboard shortcuts

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