在java中寻找基于角色的身份验证解决方案

发布于 2024-11-24 13:40:15 字数 546 浏览 3 评论 0原文

我正在构建一个与用户身份验证相关的项目。

该项目是关于公司的任务经理的。

公司下设多个部门,一个部门可能包含多个子部门,子部门又可以有子部门。

一个部门的经理可以创建/修改/删除本部门的任务。

其他人只能看到任务。

当他创建一个任务时,他应该指定操作员(谁将完成该工作)和负责人(谁将负责该任务)。运营商和充电商应属于某些指定部门。

例如,有一个部门名为“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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

[浮城] 2024-12-01 13:40:15

看一下 Spring Security

Spring Security 是一个功能强大且高度可定制的身份验证和访问控制框架。

Take a look at Spring Security.

Spring Security is a powerful and highly customizable authentication and access-control framework.

罗罗贝儿 2024-12-01 13:40:15

另一个选择是 Apache Shiro。它非常灵活并且可以嵌入到几乎任何类型的 Java 项目中。

Another option is Apache Shiro. It's very flexible and embeddable in almost any kind of Java project.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文