dao

package
v0.0.0-...-f0b2648 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddGroupToNode

func AddGroupToNode(groupId interface{}, nodeId int, permissions ...int) error

将一个节点授权给组

func AddNodeToNode

func AddNodeToNode(srcNodeId, tarNodeId interface{}, userId ...int) error

加入一条资源的管理关系,可选参数userId如果传入,则判断两个节点是否都有权限

func AddUser

func AddUser(name, cnName string) error

Add user when user first login.

func AddUserToGroup

func AddUserToGroup(userId, groupId interface{}) error

将一个用户加入组

func AddUserToNode

func AddUserToNode(userId interface{}, nodeId int, permissions ...int) error

将一个节点授权给一个用户

func CreateGroup

func CreateGroup(name, cnName string) error

Create a group.

func CreateNode

func CreateNode(name, description string, userId, parentId int, opts ...interface{}) error

将一个节点加入树

func DeleteNode

func DeleteNode(nodeId interface{}) error

func DeleteResourceRelationship

func DeleteResourceRelationship(srcNodeId, tarNodeId interface{}) error

func GetAllNodes

func GetAllNodes() ([]*model.DBResourceNode, error)

Fetch all node of the tree. For be used by cache model.

func GetAllResourceNodes

func GetAllResourceNodes(userId interface{}, isFull ...bool) ([]*model.ResourceNode, error)

获取所有节点列表

func GetGroupPermission

func GetGroupPermission(groupId, nodeId int) (int64, error)

获取一个组对一个节点的权限

func GetGroupUsers

func GetGroupUsers(groupId interface{}) ([]*model.DBUser, error)

获取组内的所有用户

func GetNodeGraph

func GetNodeGraph(nodeId interface{}) (*model.Graph, error)

获取指定节点的图

func GetTree

func GetTree(userId interface{}, isFull ...bool) (*model.Tree, error)

获取指定用户的树,可选获取不分权限的整棵树。

func GetTreeNodeGroups

func GetTreeNodeGroups(nodeId interface{}) ([]*model.DBGroup, error)

获取节点有权限的组,只有是显示设定,而不是继承来的才有显示。

func GetTreeNodeUsers

func GetTreeNodeUsers(nodeId interface{}) ([]*model.DBUser, error)

获取节点有权限的用户,只有是显示设定,而不是继承来的才有显示。

func GetUserPermission

func GetUserPermission(userId, nodeId int) (int64, error)

获取一个用户对一个节点的权限。

func PreDeleteNode

func PreDeleteNode(nodeId interface{}) (*model.Graph, error)

func UpdataGroupNodePermissions

func UpdataGroupNodePermissions(groupId, nodeId interface{}, permissions int) error

func UpdataUserNodePermissions

func UpdataUserNodePermissions(userId, nodeId interface{}, permissions int) error

func UpdateNodeName

func UpdateNodeName(name, cnName string, nodeId interface{}, userId ...interface{}) error

更新节点名称,可选参数同于权限验证。如果想验证则传入userid

Types

This section is empty.

Jump to

Keyboard shortcuts

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