Documentation
¶
Index ¶
- func Casbin() iris.Handler
- func Check(tenantId consts.TenantId, r *http.Request, userId string) (bool, error)
- func CheckProjectPerm(tenantId consts.TenantId, r *http.Request, userId uint) (bool, error)
- func CreateOplog(tenantId consts.TenantId, ol model.Oplog) error
- func FindInId(tenantId consts.TenantId, ids []string) (roles []v1.RoleResp, error error)
- func FindUserById(tenantId consts.TenantId, id uint) (user v1.UserResp, err error)
- func FindUserDetailById(tenantId consts.TenantId, id uint) (user v1.UserResp, err error)
- func GetSysRoles(tenantId consts.TenantId, users ...*v1.UserResp)
- func InitCheck() iris.Handler
- func IsAdminUser(tenantId consts.TenantId, id uint) (ret bool, err error)
- func JwtHandler() iris.Handler
- func OpenCheck() iris.Handler
- func OperationRecord() iris.Handler
- func ProjectPerm() iris.Handler
- type BaseModel
- type ProjectMemberModel
- type ProjectPermModel
- type ProjectRolePermModel
- type SysRole
- type SysUser
- type SysUserProfileModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Check ¶
Check checks the username, request's method and path and returns true if permission grandted otherwise false.
func CheckProjectPerm ¶
func FindUserById ¶
func FindUserDetailById ¶
func JwtHandler ¶
func JwtHandler() iris.Handler
Types ¶
type BaseModel ¶
type BaseModel struct { ID uint `gorm:"primary_key" sql:"type:INT(10) UNSIGNED NOT NULL" json:"id"` CreatedAt *time.Time `json:"createdAt,omitempty"` UpdatedAt *time.Time `json:"updatedAt,omitempty"` Deleted bool `json:"-" gorm:"default:false"` Disabled bool `json:"disabled,omitempty" gorm:"default:false"` }
type ProjectMemberModel ¶
type ProjectMemberModel struct { BaseModel ProjectId uint `json:"projectId"` ProjectRoleId uint `json:"projectRoleId"` UserId uint `json:"userId"` }
func GetUserCurrentRole ¶
func GetUserCurrentRole(tenantId consts.TenantId, userId uint) (data ProjectMemberModel, err error)
func (ProjectMemberModel) TableName ¶
func (ProjectMemberModel) TableName() string
type ProjectPermModel ¶
type ProjectPermModel struct { BaseModel Name string `gorm:"index:perm_index,unique;not null ;type:varchar(200)" json:"name" validate:"required,gte=4,lte=50"` DisplayName string `gorm:"type:varchar(256)" json:"displayName"` Description string `gorm:"type:varchar(256)" json:"description"` Act string `gorm:"index:perm_index;type:varchar(50)" json:"act" validate:"required"` }
func GetProjectPerm ¶
func GetProjectPerm(tenantId consts.TenantId, path, method string) (res ProjectPermModel, err error)
func (ProjectPermModel) TableName ¶
func (ProjectPermModel) TableName() string
type ProjectRolePermModel ¶
type ProjectRolePermModel struct { BaseModel v1.ProjectRolePermBase }
func GetProjectRolePerm ¶
func GetProjectRolePerm(tenantId consts.TenantId, roleId, permId uint) (data ProjectRolePermModel, err error)
func (ProjectRolePermModel) TableName ¶
func (ProjectRolePermModel) TableName() string
type SysUser ¶
type SysUserProfileModel ¶
type SysUserProfileModel struct { BaseModel Phone string `json:"phone"` CurrProjectId uint `json:"currProjectId"` UserId uint `json:"userId"` }
func (SysUserProfileModel) TableName ¶
func (SysUserProfileModel) TableName() string
Click to show internal directories.
Click to hide internal directories.