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

Deadly 提交于 2019-12-23 10:40:16

问题


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.

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?


回答1:


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


See Also

  • Writing an authorization filter for my web app(JSF 2.0)


来源:https://stackoverflow.com/questions/13946119/how-to-implement-role-based-access-control-java-mysql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!