Skip to content

Commit

Permalink
fix🐛 修复部门数据权限
Browse files Browse the repository at this point in the history
  • Loading branch information
wenjianzhang authored May 22, 2021
2 parents 8a58fb5 + d71ff80 commit 5e10b63
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

系统初始化极度简单,只需要配置文件中,修改数据库连接,系统启动后会自动初始化数据库信息以及必须的基础数据

[在线文档](https://doc.go-admin.dev)
[在线文档](https://doc.go-admin.dev)

[github在线文档](https://wenjianzhang.github.io)

Expand Down
2 changes: 1 addition & 1 deletion common/actions/permission.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func Permission(tableName string, p *DataPermission) func(db *gorm.DB) *gorm.DB
case "3":
return db.Where(tableName+".create_by in (SELECT user_id from sys_user where dept_id = ? )", p.DeptId)
case "4":
return db.Where(tableName+".create_by in (SELECT user_id from sys_user where sys_user.dept_id in(select dept_id from sys_dept where dept_path like ? ))", "%"+pkg.IntToString(p.DeptId)+"%")
return db.Where(tableName+".create_by in (SELECT user_id from sys_user where sys_user.dept_id in(select dept_id from sys_dept where dept_path like ? ))", "%/"+pkg.IntToString(p.DeptId)+"/%")
case "5":
return db.Where(tableName+".create_by = ?", p.UserId)
default:
Expand Down

0 comments on commit 5e10b63

Please sign in to comment.