简体   繁体   English

Java/MySql 如何实现基于角色的访问控制?

[英]How to implement role-based access control Java/MySql?

I am planing to start a web-based project that involves user registrations just like forums/CMS, but my barrier is that I have not idea how to implement the so-called role-based access control.我打算开始一个基于网络的项目,它涉及用户注册,就像论坛/CMS一样,但我的障碍是我不知道如何实现所谓的基于角色的访问控制。

I googled for "role-based access control" and I found in the results books about: Design Patters.我在谷歌上搜索了“基于角色的访问控制”,我在结果书中找到了关于:设计模式。

Is this related to what I need?这与我需要的有关吗? Is there a tutorial about implementing this idea?有关于实现这个想法的教程吗? Is the implementation on database-side or language programming-side?是在数据库端还是语言编程端实现?

Any reference?有参考吗? Any title?有标题吗?

Design your tables such that user can have one or multiple role based on your system设计你的表,让用户可以根据你的系统拥有一个或多个角色

Define your access to pages for group定义您对组页面的访问权限

admin.allowed = .*
user.allowed=/home/.*,/profile/.*

in some properties file在某些属性文件中

Create a Web Filter that reads the user from session and determines the role and sees if the page it is being requested is allowed if not it redirects to some other page创建一个 Web 过滤器,从会话中读取用户并确定角色,并查看是否允许请求的页面,如果不允许则重定向到其他页面


See Also也可以看看

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM