Documentation ¶
Index ¶
- Constants
- Variables
- func AddRoleUserRelation(orgId, userId, roleId int64) errs.SystemErrorInfo
- func ChangeDefaultRole() errs.SystemErrorInfo
- func ClearDepartmentRoleList(orgId, departmentId, projectId int64) errs.SystemErrorInfo
- func ClearUserRoleList(orgId, userId, projectId int64) errs.SystemErrorInfo
- func CopyPermission(permissionList *[]bo.RolePermissionOperationBo, roleId int64, orgId int64) errs.SystemErrorInfo
- func CreateRole(orgId, userId int64, input vo.CreateRoleReq, groupId int64) (int64, errs.SystemErrorInfo)
- func DeleteRoles(orgId int64, roleIds []int64, operatorId int64) errs.SystemErrorInfo
- func GetGroupRoleList(orgId int64) (*[]bo.RoleGroupBo, errs.SystemErrorInfo)
- func GetOrgRoleUser(orgId int64, projectId int64, langCodes []string) (*[]bo.RoleUser, errs.SystemErrorInfo)
- func GetOrgRoleUserBatch(orgIds []int64, projectId int64, langCodes []string) (*[]bo.RoleUserWithOrgId, errs.SystemErrorInfo)
- func GetPermissionById(permissionId int64) (bo2.PermissionBo, errs.SystemErrorInfo)
- func GetPermissionByType(permissionType int) ([]bo2.PermissionBo, errs.SystemErrorInfo)
- func GetPermissionList() (*[]bo2.PermissionBo, errs.SystemErrorInfo)
- func GetPermissionOperationList() (*[]bo2.PermissionOperationBo, errs.SystemErrorInfo)
- func GetPermissionOperationListByPermissionId(permissionId int64) ([]bo2.PermissionOperationBo, errs.SystemErrorInfo)
- func GetProjectPermission(orgId, projectId int64) ([]bo2.PermissionBo, errs.SystemErrorInfo)
- func GetRole(orgId, projectId, roleId int64) (*bo.RoleBo, errs.SystemErrorInfo)
- func GetRoleByName(orgId, projectId int64, roleName string) (*bo.RoleBo, errs.SystemErrorInfo)
- func GetRoleList(orgId int64, projectId int64, roleIds []int64, includeAll bool) ([]bo.RoleBo, errs.SystemErrorInfo)
- func GetSysDefaultRoles(orgId int64) ([]bo.RoleBo, errs.SystemErrorInfo)
- func JudgeRoleName(name string) errs.SystemErrorInfo
- func RemoveRoleDepartmentRelation(orgId int64, deptIds []int64, operatorId int64) errs.SystemErrorInfo
- func RemoveRoleUserRelation(orgId int64, userIds []int64, operatorId int64) errs.SystemErrorInfo
- func RoleInit(orgId int64, tx sqlbuilder.Tx) (*bo.RoleInitResp, errs.SystemErrorInfo)
- func UpdateRole(orgId int64, projectId int64, roleId int64, updateBo bo.UpdateRoleBo, ...) errs.SystemErrorInfo
- func UpdateRolePermissionOperation(orgId int64, userId int64, roleId int64, ...) errs.SystemErrorInfo
- func UpdateUserOrgRole(role *bo.RoleBo, orgId int64, currentUserId int64, userIds []int64, ...) (int64, errs.SystemErrorInfo)
Constants ¶
View Source
const RoleInitSql = consts.TemplateDirPrefix + "role_init.template"
Variables ¶
View Source
var DefaultRoleName = []string{
"组织超级管理员",
"组织管理员",
"组织成员",
"负责人",
"项目成员",
}
特殊角色名称
Functions ¶
func AddRoleUserRelation ¶
func AddRoleUserRelation(orgId, userId, roleId int64) errs.SystemErrorInfo
添加角色和用户关联
func ChangeDefaultRole ¶
func ChangeDefaultRole() errs.SystemErrorInfo
func ClearDepartmentRoleList ¶
func ClearDepartmentRoleList(orgId, departmentId, projectId int64) errs.SystemErrorInfo
删除用户角色列表缓存
func ClearUserRoleList ¶
func ClearUserRoleList(orgId, userId, projectId int64) errs.SystemErrorInfo
删除用户角色列表缓存
func CopyPermission ¶
func CopyPermission(permissionList *[]bo.RolePermissionOperationBo, roleId int64, orgId int64) errs.SystemErrorInfo
func CreateRole ¶
func CreateRole(orgId, userId int64, input vo.CreateRoleReq, groupId int64) (int64, errs.SystemErrorInfo)
func DeleteRoles ¶
func DeleteRoles(orgId int64, roleIds []int64, operatorId int64) errs.SystemErrorInfo
func GetGroupRoleList ¶
func GetGroupRoleList(orgId int64) (*[]bo.RoleGroupBo, errs.SystemErrorInfo)
组织角色组缓存
func GetOrgRoleUser ¶
func GetOrgRoleUser(orgId int64, projectId int64, langCodes []string) (*[]bo.RoleUser, errs.SystemErrorInfo)
获取组织用户特殊角色
func GetOrgRoleUserBatch ¶
func GetOrgRoleUserBatch(orgIds []int64, projectId int64, langCodes []string) (*[]bo.RoleUserWithOrgId, errs.SystemErrorInfo)
func GetPermissionById ¶
func GetPermissionById(permissionId int64) (bo2.PermissionBo, errs.SystemErrorInfo)
TODO 切换lesscode-permission
func GetPermissionByType ¶
func GetPermissionByType(permissionType int) ([]bo2.PermissionBo, errs.SystemErrorInfo)
TODO 切换lesscode-permission
func GetPermissionList ¶
func GetPermissionList() (*[]bo2.PermissionBo, errs.SystemErrorInfo)
TODO 切换lesscode-permission
func GetPermissionOperationList ¶
func GetPermissionOperationList() (*[]bo2.PermissionOperationBo, errs.SystemErrorInfo)
func GetPermissionOperationListByPermissionId ¶
func GetPermissionOperationListByPermissionId(permissionId int64) ([]bo2.PermissionOperationBo, errs.SystemErrorInfo)
func GetProjectPermission ¶
func GetProjectPermission(orgId, projectId int64) ([]bo2.PermissionBo, errs.SystemErrorInfo)
TODO 切换lesscode-permission 获取项目权限项(只取部分)
func GetRoleByName ¶
func GetRoleList ¶
func GetRoleList(orgId int64, projectId int64, roleIds []int64, includeAll bool) ([]bo.RoleBo, errs.SystemErrorInfo)
projectId:传0表示忽略此条件 org_id = 0:传空忽略此条件
func GetSysDefaultRoles ¶
func GetSysDefaultRoles(orgId int64) ([]bo.RoleBo, errs.SystemErrorInfo)
func JudgeRoleName ¶
func JudgeRoleName(name string) errs.SystemErrorInfo
func RemoveRoleDepartmentRelation ¶
func RemoveRoleDepartmentRelation(orgId int64, deptIds []int64, operatorId int64) errs.SystemErrorInfo
移除角色和部门关联
func RemoveRoleUserRelation ¶
func RemoveRoleUserRelation(orgId int64, userIds []int64, operatorId int64) errs.SystemErrorInfo
移除角色和用户关联
func RoleInit ¶
func RoleInit(orgId int64, tx sqlbuilder.Tx) (*bo.RoleInitResp, errs.SystemErrorInfo)
func UpdateRole ¶
func UpdateRole(orgId int64, projectId int64, roleId int64, updateBo bo.UpdateRoleBo, operatorId int64) errs.SystemErrorInfo
没有projectId就传0
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.