如何根据spring-security用户权限生成内容
我想根据使用spring-security登录的用户的用户权限生成一些html内容。到目前为止,我在互联网上找不到太多关于这个主题的信息,我想知道什么是实现这个主题的好方法。
到目前为止,我正在考虑制作一个自定义标签,将其附加到一个控制器,该控制器链接到一个可以生成菜单等的类。我只是不确定如何从 spring-security 获取用户的用户角色/权限。
I want to generate some html content based on the user rights of a user who logged in with spring-security. I can't find much about this subject on the internet so far and i'm wondering what would be a good way to implement this.
So far i was thinking about making a custom tag, attach it to a controller who links to a class that can generate, for example, the menu. I'm just not sure how get the user roles/rights of the user from spring-security.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查 spring security 标签以根据用户角色创建动态内容。 Spring Security Taglibs 参考。
Check the spring security tags to create dynamic content based on user roles. Spring Security Taglibs reference.
像这样的事情怎么样:
How about something like this: