auth

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2020 License: MIT Imports: 0 Imported by: 0

README

auth

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IAuth

type IAuth interface {
	AddUser(IUser) (int64, error) // 添加用户
	AddRole(IRole) (int64, error) // 添加角色
	AddPerm(IPerm) (int64, error) // 添加权限

	UserRoleLink(IUserRole) error // 修改用户角色
	RolePermLink(IRolePerm) error // 修改角色权限

	DelUser(IUser) error // 禁用用户
	DelRole(IRole) error // 禁用角色
	DelPerm(IPerm) error // 禁用权限

	UserList(IPage) ([]IUser, error) // 用户列表
	RoleList(IPage) ([]IRole, error) // 角色列表
	PermList(IPage) ([]IPerm, error) // 权限列表

	GetAllByUser(IQuery) error // 根据用户id获取整个权限信息
}

func NewRBAC

func NewRBAC() IAuth

type IPage

type IPage interface {
	UserPageTurn() ([]IUser, error)
	RolePageTurn() ([]IRole, error)
	PermPageTurn() ([]IPerm, error)
}

type IPerm

type IPerm interface {
	Add() (int64, error)
	Get() (IPerm, error)
	Del() error
}

type IQuery

type IQuery interface {
	GetAllByUser() error
}

type IRole

type IRole interface {
	Add() (int64, error)
	Get() (IRole, error)
	Del() error
}

type IRolePerm

type IRolePerm interface {
	Add() error
	Del() error
}

type IUser

type IUser interface {
	Add() (int64, error)
	Get() (IUser, error)
	Del() error
}

type IUserRole

type IUserRole interface {
	Add() error
	Del() error
}

type RBAC

type RBAC struct{}

func (*RBAC) AddPerm

func (self *RBAC) AddPerm(p IPerm) (int64, error)

func (*RBAC) AddRole

func (self *RBAC) AddRole(r IRole) (int64, error)

func (*RBAC) AddUser

func (self *RBAC) AddUser(u IUser) (int64, error)

func (*RBAC) DelPerm

func (self *RBAC) DelPerm(p IPerm) error

func (*RBAC) DelRole

func (self *RBAC) DelRole(r IRole) error

func (*RBAC) DelUser

func (self *RBAC) DelUser(u IUser) error

func (*RBAC) GetAllByUser

func (self *RBAC) GetAllByUser(q IQuery) error

func (*RBAC) PermList

func (self *RBAC) PermList(p IPage) ([]IPerm, error)

func (*RBAC) RoleList

func (self *RBAC) RoleList(p IPage) ([]IRole, error)
func (self *RBAC) RolePermLink(rp IRolePerm) error

func (*RBAC) UserList

func (self *RBAC) UserList(p IPage) ([]IUser, error)
func (self *RBAC) UserRoleLink(ur IUserRole) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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