Documentation ¶
Index ¶
- func AppAdd(name, email, comments string) (int64, string, error)
- func RelationResourceRoleAdd(appID, resourceID, roleID int64) (int64, error)
- func RelationResourceRoleDel(appID, resID, roleID int64) error
- func RelationRoleQuery(appID int64, email, sort, order string, offset, limit int) (int, []meta.RoleUser, error)
- func RelationRoleUserQuery(appID, roleID int64, email, sort, order string, offset, limit int) (int, []meta.RoleUser, error)
- func RelationUserQuery(appID, roleID int64, sort, order string, offset, limit int) (int, []meta.RoleUser, error)
- func RelationUserRoleDel(appID, roleID int64, email, owner string) error
- func RelationValidate(appID, resID int64, email string) error
- func ResourceAdd(appID int64, name, comments string) (int64, error)
- func ResourceDelete(resID int64) error
- func ResourceGet(appID int64, resID ...int64) ([]meta.Resource, error)
- func ResourceQuery(appID, resID int64, sort, order string, offset, limit int) (int, []meta.Resource, error)
- func RoleAdd(appID int64, name, user, email, comments string) (int64, error)
- func RoleDelete(appID, roleID int64) error
- func RoleGetWithToken(token, email string) ([]meta.Role, error)
- func RoleQuery(appID, roleID int64, email, sort, order string, offset, limit int) (int, []meta.RoleUser, error)
- func RoleResourceDelete(appID, roleID, resourceID int64) error
- func RoleResourceQuery(appID, resID, roleID int64, sort, order string, offset, limit int) (int, []meta.RoleResource, error)
- func RoleUpdate(appID, roleID int64, name, comments string) error
- func RoleUserAdd(appID, roleID int64, name, email string) (int64, error)
- func RoleUserDelete(appID, roleID int64, email string) error
- func RoleUserGet(appID, roleID int64, email string) ([]meta.RoleUser, error)
- func ServerInit() error
- func UnrelatedResourceRoles(appID, resourceID int64, email, sort, order string, offset, limit int) (int, []meta.Role, error)
- func UserAdd(appID int64, name, email string) (int64, error)
- func UserGetAll(appID int64) ([]meta.User, error)
- func UserResourceGet(appID int64, email string) (result []int64, err error)
- func UserUpdate(appID, userID int64, name, email string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RelationResourceRoleAdd ¶
RelationResourceRoleAdd 把资源授权给角色
func RelationResourceRoleDel ¶
RelationResourceRoleDel 删除授权
func RelationRoleQuery ¶
func RelationRoleQuery(appID int64, email, sort, order string, offset, limit int) (int, []meta.RoleUser, error)
RelationRoleQuery 查询指定用户所在的role, 带分页功能.
func RelationRoleUserQuery ¶
func RelationRoleUserQuery(appID, roleID int64, email, sort, order string, offset, limit int) (int, []meta.RoleUser, error)
RelationRoleUserQuery 根据AppID, email, RoleID查找关系, 带分页功能.
func RelationUserQuery ¶
func RelationUserQuery(appID, roleID int64, sort, order string, offset, limit int) (int, []meta.RoleUser, error)
RelationUserQuery 查询指定role的所有用户, 带分页功能.
func RelationUserRoleDel ¶
RelationUserRoleDel 删除角色中的指定用户, 如果用户是这个角色的添加者可以删除角色关联的用户,或者是管理员
func RelationValidate ¶
RelationValidate 权限验证
func ResourceAdd ¶
ResourceAdd 添加资源
func ResourceGet ¶
ResourceGet 查询指定资源信息
func ResourceQuery ¶
func ResourceQuery(appID, resID int64, sort, order string, offset, limit int) (int, []meta.Resource, error)
ResourceQuery 查询指定应用的所有资源
func RoleGetWithToken ¶
RoleGetWithToken 根据token查询role.
func RoleQuery ¶
func RoleQuery(appID, roleID int64, email, sort, order string, offset, limit int) (int, []meta.RoleUser, error)
RoleQuery 根据条件查找用户有关的role
func RoleResourceDelete ¶
RoleResourceDelete 按role,resource查询关联信息.
func RoleResourceQuery ¶
func RoleResourceQuery(appID, resID, roleID int64, sort, order string, offset, limit int) (int, []meta.RoleResource, error)
RoleResourceQuery 根据AppID, ResourceID, RoleID查找关系, 带分页功能.
func RoleUpdate ¶
RoleUpdate 修改角色信息, 需要指定roleID.
func RoleUserAdd ¶
RoleUserAdd 为角色添加用户.
func RoleUserDelete ¶
RoleUserDelete 按role,email查询关联信息.
func RoleUserGet ¶
RoleUserGet 按role,email查询关联信息.
func UnrelatedResourceRoles ¶
func UnrelatedResourceRoles(appID, resourceID int64, email, sort, order string, offset, limit int) (int, []meta.Role, error)
UnrelatedResourceRoles 根据AppID, ResourceID, email查找未关联的roles, 带分页功能.
func UserResourceGet ¶
UserResourceGet 根据用户邮件地址获取资源.
Types ¶
This section is empty.