mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 02:04:09 +00:00
doc : add notes
This commit is contained in:
@@ -2,8 +2,10 @@ package models
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/jinzhu/gorm"
|
||||
"go-admin/tools"
|
||||
"go-admin/tools/config"
|
||||
)
|
||||
|
||||
type DataPermission struct {
|
||||
@@ -14,6 +16,12 @@ type DataPermission struct {
|
||||
}
|
||||
|
||||
func (e *DataPermission) GetDataScope(tbname string, table *gorm.DB) (*gorm.DB, error) {
|
||||
|
||||
if !config.ApplicationConfig.EnableDP {
|
||||
usageStr := `数据权限已经为您` + tools.Green(`关闭`) + `,如需开启请参考配置文件字段说明`
|
||||
fmt.Printf("%s\n", usageStr)
|
||||
return table, nil
|
||||
}
|
||||
SysUser := new(SysUser)
|
||||
SysRole := new(SysRole)
|
||||
SysUser.UserId = e.UserId
|
||||
|
||||
Reference in New Issue
Block a user