Java 桌面应用程序和功能授权
我对 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于您的用例,我绝对会推荐 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.