在java中寻找基于角色的身份验证解决方案
我正在构建一个与用户身份验证相关的项目。
该项目是关于公司的任务经理的。
公司下设多个部门,一个部门可能包含多个子部门,子部门又可以有子部门。
一个部门的经理可以创建/修改/删除本部门的任务。
其他人只能看到任务。
当他创建一个任务时,他应该指定操作员(谁将完成该工作)和负责人(谁将负责该任务)。运营商和充电商应属于某些指定部门。
例如,有一个部门名为“department01”,该部门包含两个子部门:“开发”和“设计”。
现在用户“John”是“development”的管理员,因此他可以添加属于“development”的任务,并选择属于“department01”的运营商和充电器,因为“department01”是“development”的父级。
系统中还有一些其他角色,例如“department01”的老板,他可以看到属于“department01”的所有任务(包含“开发”和“设计”任务)。
在这种情况下,我认为基于角色的身份验证更好。
但是我在java中没有找到相关的资料,所以请问有没有例子?
I am building a project which is related to the user authentication.
The project is about the task manager for the company.
The company contain many departments,and one department may contain more than one sub_department,the sub_department can have sub departments also.
The manager of one department can create/modify/remove tasks of his department.
Other people can only see the task.
When he create a task,he should specify the operator(who will make the job) and the charger(who will be responsible for the task). The operator and charger should belong to some specified departments.
For example,there is one department named "department01"and this department contain two sub-departments:"development",and "design".
Now user "John" is the manager of "development",so he can add task belong to "development",and choose operators and chargers belong to "department01" since the "department01" is the parent of "development".
Also there are some other roles in the system,for example, the boss of "department01",he can see all the tasks belong to "department01" (contain tasks of "development" and "design").
In this case, I think the role-based authentication is better.
But I do not found any related information in java,so I ask if there is any example?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看一下 Spring Security。
Take a look at Spring Security.
另一个选择是 Apache Shiro。它非常灵活并且可以嵌入到几乎任何类型的 Java 项目中。
Another option is Apache Shiro. It's very flexible and embeddable in almost any kind of Java project.