本文介绍了简单的方法在Play中的所有控制器上使用安全模块(或类似)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有一种方法,我可以告诉Play使用安全模块为每个控制器,而不必添加 With(Secure.class)到所有我的控制器或使我所有的控制器扩展一个类。想要任何人?

I'd like to know if there's a way I can tell Play to use the Secure module for every controller, without having to add With(Secure.class) to all my controllers or making all my controllers extend a single class. Ideas anyone?

推荐答案

是的,你可以使用播放插件截取每个请求。只需看看modules / docviewer。它很容易实现。目前我正在处理一个安全模块,其中一切都被默认禁止。

Yes you can intercept every-request with a play-plugin. Just have a look on modules/docviewer. It's very easy to implement. At the moment I'm working on a security-module where everything is forbidden as a default.

这篇关于简单的方法在Play中的所有控制器上使用安全模块(或类似)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 14:47