rbac

package
v0.0.0-...-33f8601 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client rbac 客户端.

func New

func New(host, token string) *Client

New 创建rbac客户端.

func (Client) DeleteResource

func (c Client) DeleteResource(resID int64) error

DeleteResource 删除资源.

func (Client) DeleteResourceRole

func (c Client) DeleteResourceRole(resID, roleID int64) error

DeleteResourceRole 删除资源与角色对应关系.

func (Client) DeleteRole

func (c Client) DeleteRole(id int64, name string) error

DeleteRole 删除角色,根据名称或者ID.

func (Client) DeleteRoleUser

func (c Client) DeleteRoleUser(roleID int64, email string) error

DeleteRoleUser 删除角色中用户.

func (Client) DeleteUser

func (c Client) DeleteUser(userID int64) error

DeleteUser 删除用户.

func (Client) GetResource

func (c Client) GetResource(resID int64) (meta.Resource, error)

GetResource 获取资源.

func (Client) GetResourceRoles

func (c Client) GetResourceRoles(resID int64) ([]meta.RoleResource, error)

GetResourceRoles 获取资源对应角色.

func (Client) GetResourceRolesUnrelated

func (c Client) GetResourceRolesUnrelated(resID int64, email string) ([]meta.Role, error)

GetResourceRolesUnrelated 获取未资源对应的所有角色列表.

func (Client) GetRole

func (c Client) GetRole(roleID int64) (meta.Role, error)

GetRole 获取角色信息.

func (Client) GetRoleUsers

func (c Client) GetRoleUsers(roleID int64) ([]meta.RoleUser, error)

GetRoleUsers 根据角色ID邮件获取相关用户.

func (Client) GetUser

func (c Client) GetUser(email string) (meta.User, error)

GetUser 获取用户信息.

func (Client) GetUserResourceIDs

func (c Client) GetUserResourceIDs(email string) ([]int64, error)

GetUserResourceIDs 根据用户邮箱,获取关联的资源ID.

func (Client) GetUserResources

func (c Client) GetUserResources(email string) ([]meta.Resource, error)

GetUserResources 根据用户邮箱,获取关联的资源.

func (Client) GetUserRoles

func (c Client) GetUserRoles(email string) ([]meta.RoleUser, error)

GetUserRoles 根据邮件获取关联角色信息.

func (Client) PostResource

func (c Client) PostResource(name, comments string) (int64, error)

PostResource 添加资源.

func (Client) PostRole

func (c Client) PostRole(name, comments, user, email string) (int64, error)

PostRole 添加角色.

func (Client) PostRoleResource

func (c Client) PostRoleResource(roleID, resID int64) (int64, error)

PostRoleResource 关联角色与资源.

func (Client) PostRoleUser

func (c Client) PostRoleUser(roleID int64, user, email string) (int64, error)

PostRoleUser 给角色添加用户.

func (Client) PostUser

func (c Client) PostUser(user, email string) (int64, error)

PostUser 添加用户.

func (Client) PutRole

func (c Client) PutRole(roleID int64, name, comments string) error

PutRole 修改角色信息.

func (Client) PutUser

func (c Client) PutUser(userID int64, user, email string) error

PutUser 更新用户信息.

Jump to

Keyboard shortcuts

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