Java 桌面应用程序和功能授权

发布于 2024-12-07 03:21:51 字数 384 浏览 1 评论 0原文

我对 java 开发相当陌生,我发现自己的任务是为用 java 编写的桌面应用程序实现功能授权系统。

目前,该应用程序需要在启动时进行用户身份验证,并且通过 LDAP 针对活动目录服务器对用户进行身份验证。

目前的应用程序没有适当的用户权限系统,一旦用户通过身份验证,他们就可以完全访问应用程序的全部功能。

我需要做的是定义一些可以访问不同功能的用户角色或组,即 user:Alice(组:Admin)可能会在 JTable 的弹出菜单中看到 menuItem:EditCell,但 user:Bob(组:农民)可能不会。

有人建议我研究 Spring 安全性和方法/类注释,但我发现很难理解迄今为止找到的信息。

有没有类似经历的人可以提供一些帮助?

干杯,

I'm fairly new to java development and I have found myself tasked with implementing a functionality authorization system for a desktop application written in java.

Currently the application requires user authentication at startup and users are authenticated against an active directory server via LDAP.

The application as it stands has no user privillage system in place, once a user is authenticated they have full access to the applications entire functionality.

What I need to do is define a number of user roles or groups which have access to different functionality i.e. user:Alice (of group:Admin) may see menuItem:EditCell in a popup menu for a JTable but user:Bob (of group:Peasant) may not.

It has been suggested that I look into Spring security and method/class annotation but I'm finding it a little difficult to get my head around the information I have found so far.

Is there anyone who has had a similar experience around who might be able to offer some assistance?

Cheers,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

日暮斜阳 2024-12-14 03:21:51

对于您的用例,我绝对会推荐 Shiro 而不是 Spring。查看他们的网站并浏览10 分钟快速指南。您会惊讶地发现,在家里使用简单、直接的代码就可以完成很多工作。

为了进行简单测试,您可以在 Shiro 本身内定义角色,但最终您会希望将所有角色放入 LDAP 中。

I would definitely recommend Shiro over Spring for your use case. Take a look at their website and go through the 10 minute quick guide. You'll be surprised at home much you can get done with simple, straightforward code.

For simple testing you can define roles within Shiro itself, but eventually you are going to want to put all the roles into your LDAP.

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