Giter VIP home page Giter VIP logo

Comments (3)

abel533 avatar abel533 commented on September 4, 2024

这个方法输出的日志如下:

DEBUG [main] - ==>  Preparing: select u.id, u.user_name, u.user_password, u.user_email, u.user_info, u.head_img, u.create_time, r.id role_id, r.role_name role_role_name, r.enabled role_enabled, r.create_by role_create_by, r.create_time role_create_time, p.id role_privilege_id, p.privilege_name role_privilege_privilege_name, p.privilege_url role_privilege_privilege_url from sys_user u inner join sys_user_role ur on u.id = ur.user_id inner join sys_role r on ur.role_id = r.id inner join sys_role_privilege rp on rp.role_id = r.id inner join sys_privilege p on p.id = rp.privilege_id 
DEBUG [main] - ==> Parameters: 
TRACE [main] - <==    Columns: id, user_name, user_password, user_email, user_info, head_img, create_time, role_id, role_role_name, role_enabled, role_create_by, role_create_time, role_privilege_id, role_privilege_privilege_name, role_privilege_privilege_url
TRACE [main] - <==        Row: 1, admin, 123456, [email protected], <<BLOB>>, <<BLOB>>, 2016-06-07 01:11:12.0, 1, 管理员, 1, 1, 2016-04-01 17:02:14.0, 1, 用户管理, /users
TRACE [main] - <==        Row: 1, admin, 123456, [email protected], <<BLOB>>, <<BLOB>>, 2016-06-07 01:11:12.0, 1, 管理员, 1, 1, 2016-04-01 17:02:14.0, 3, 系统日志, /logs
TRACE [main] - <==        Row: 1, admin, 123456, [email protected], <<BLOB>>, <<BLOB>>, 2016-06-07 01:11:12.0, 1, 管理员, 1, 1, 2016-04-01 17:02:14.0, 2, 角色管理, /roles
TRACE [main] - <==        Row: 1, admin, 123456, [email protected], <<BLOB>>, <<BLOB>>, 2016-06-07 01:11:12.0, 2, 普通用户, 1, 1, 2016-04-01 17:02:34.0, 4, 人员维护, /persons
TRACE [main] - <==        Row: 1001, test, 123456, [email protected], <<BLOB>>, <<BLOB>>, 2016-06-07 00:00:00.0, 2, 普通用户, 1, 1, 2016-04-01 17:02:34.0, 4, 人员维护, /persons
TRACE [main] - <==        Row: 1, admin, 123456, [email protected], <<BLOB>>, <<BLOB>>, 2016-06-07 01:11:12.0, 2, 普通用户, 1, 1, 2016-04-01 17:02:34.0, 5, 单位维护, /companies
TRACE [main] - <==        Row: 1001, test, 123456, [email protected], <<BLOB>>, <<BLOB>>, 2016-06-07 00:00:00.0, 2, 普通用户, 1, 1, 2016-04-01 17:02:34.0, 5, 单位维护, /companies
DEBUG [main] - <==      Total: 7
用户数:2
用户名:admin
角色名:管理员
权限名:用户管理
权限名:系统日志
权限名:角色管理
角色名:普通用户
权限名:人员维护
权限名:单位维护
用户名:test
角色名:普通用户
权限名:人员维护
权限名:单位维护

from book.

abel533 avatar abel533 commented on September 4, 2024

通过下面这个图(包含三级中的关键信息)看一下层级关系:
bbb

从整体看,就两个结果,admin 和 test 两个用户。

在 admin 中有俩角色 管理员 和 普通用户。

在管理员角色中有3个具体的权限。

从顶层判断就是先看是不是同一个用户,再看是不是同一个角色,最后区分权限。

判断用户的时候不会考虑角色和权限信息(这是由映射中的 <id> 决定的),判断角色也不会受权限影响。

如果你执行的结果和这里的不同,对比上面日志中的数据(7个ROW行)看看。

如果还是不明白,可以把你测试的详细日志发出来。

from book.

abel533 avatar abel533 commented on September 4, 2024

Debug实例状态图:
aaaa

from book.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.