【feature】添加组织数据读取权限

This commit is contained in:
XM-GO
2023-09-14 17:28:52 +08:00
parent bde42bfc9a
commit b5ee2a54b9
84 changed files with 1664 additions and 774 deletions

View File

@@ -5,26 +5,34 @@ import (
"github.com/PandaXGO/PandaKit/model"
)
const (
SELFDATASCOPE = "0"
ALLDATASCOPE = "1"
DIYDATASCOPE = "2"
ORGDATASCOPE = "3"
ORGALLDATASCOPE = "4"
)
type SysRole struct {
model.BaseModel
RoleId int64 `json:"roleId" gorm:"primary_key;AUTO_INCREMENT"`
RoleName string `json:"roleName" gorm:"type:varchar(128);comment:角色名称"`
Status string `json:"status" gorm:"type:varchar(1);comment:状态"`
RoleKey string `json:"roleKey" gorm:"type:varchar(128);comment:角色代码"`
RoleSort int64 `json:"roleSort" gorm:"type:int;comment:角色排序"`
DataScope string `json:"dataScope" gorm:"type:varchar(1);comment:数据范围1全部数据权限 2自定数据权限 3部门数据权限 4部门及以下数据权限)"`
CreateBy string `json:"createBy" gorm:"type:varchar(128);comment:创建人"`
UpdateBy string `json:"updateBy" gorm:"type:varchar(128);comment:修改人"`
Remark string `json:"remark" gorm:"type:varchar(255);comment:备注"`
ApiIds []casbin.CasbinRule `json:"apiIds" gorm:"-"`
MenuIds []int64 `json:"menuIds" gorm:"-"`
DeptIds []int64 `json:"deptIds" gorm:"-"`
RoleId int64 `json:"roleId" gorm:"primary_key;AUTO_INCREMENT"`
RoleName string `json:"roleName" gorm:"type:varchar(128);comment:角色名称"`
Status string `json:"status" gorm:"type:varchar(1);comment:状态"`
RoleKey string `json:"roleKey" gorm:"type:varchar(128);comment:角色代码"`
RoleSort int64 `json:"roleSort" gorm:"type:int;comment:角色排序"`
DataScope string `json:"dataScope" gorm:"type:varchar(1);comment:数据范围(0: 本人数据 1全部数据权限 2自定数据权限 3组织数据权限 4组织及以下数据权限)"`
CreateBy string `json:"createBy" gorm:"type:varchar(128);comment:创建人"`
UpdateBy string `json:"updateBy" gorm:"type:varchar(128);comment:修改人"`
Remark string `json:"remark" gorm:"type:varchar(255);comment:备注"`
ApiIds []casbin.CasbinRule `json:"apiIds" gorm:"-"`
MenuIds []int64 `json:"menuIds" gorm:"-"`
OrganizationIds []int64 `json:"organizationIds" gorm:"-"`
}
type MenuIdList struct {
MenuId int64 `json:"menuId"`
}
type DeptIdList struct {
DeptId int64 `json:"deptId"`
type OrganizationIdList struct {
OrganizationId int64 `json:"organizationId"`
}