简体   繁体   English

如何使用Apache Wicket实现ACL?

[英]How to implement ACL using Apache Wicket?

Im currently validating 3 times.我目前验证了 3 次。 Example delete link is only allowed to super upers.示例删除链接只允许超级用户。 So Im validating 3 times.所以我验证了 3 次。

1-In the constructor (Redirect) 2-In the wicket link contruction (Set Link to False) In the Onclick (Return) 1-在构造函数中(重定向)2-在 wicket 链接构造中(将链接设置为 False)在 Onclick(返回)中

I feel like an idiot validating 3 times.我觉得自己像个白痴验证了 3 次。 It should be something I can use to implement security in my wicket application.它应该是我可以用来在我的 wicket 应用程序中实现安全性的东西。

You can enable components depending on the role a certain user has.您可以根据特定用户的角色启用组件。 For this you have to为此你必须

  • implement your own authorization strategy and实施您自己的授权策略和
  • annotate your component according which role is allowed which action.根据允许哪个角色执行哪个操作来注释您的组件。

A sample for this approach can be found here .可以在此处找到此方法的示例。

Use Wicket-Auth-Roles.使用 Wicket-Auth-Roles。 You need to implement your own AuthenticatedWebSession and add annotations to your components.您需要实现自己的 AuthenticatedWebSession 并向您的组件添加注释。 The following tutorial contains links to examples and how to integrate it:以下教程包含指向示例的链接以及如何集成它:

https://www.google.de/search?sourceid=chrome&ie=UTF-8&q=wicket-security https://www.google.de/search?sourceid=chrome&ie=UTF-8&q=wicket-security

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM