2013-07-30 50 views
1

我有一个名为Profile的域类。我想在下面的代码来访问它的属性:Grails在访问域对象属性时警告安全问题

Profile p = new Profile() 
// doing some changes 
p.name = 'Larry' 
//.... 
p.save(flush:true) 
// then I print out the properties, and this line of code raises warning. 
print p.properties 

然后下面的警告信息显示出来:

WARN security.Security - An attempt was made to use the grailsSecurity bean, but there is no security bridge implementation defined. You must install a security plugin and/or provide a grailsSecurityBridge bean. 

我有一个弹簧安全插件。所以我不太确定这个安全问题的含义。一个不同的安全插件?

我找不到与此问题有关的任何信息。请有人帮助我吗?谢谢!

回答

0

我对“grailsS​​ecurityBridge bean”进行了搜索。结果使我得到了Grails插件平台核心:1.0.RC5,它安装在我的应用程序中。

因此,我创建了另一个项目,并试图访问配置文件属性插入和不插入。结果表明插件是原因。

我不确定在我的应用程序中是否需要此插件,但至少现在我知道原因。

更新: 我使用另一个取决于平台核心插件的插件“电子邮件确认”。所以卸载平台插件不是解决方案。

相反,我们应该实现graisSecurityBridge bean。只需按照以下链接: http://grailsrocks.github.io/grails-platform-core/guide/security.html#security_implementing_bridge http://grailsrocks.com/blog/2012/03/28/hooking-up-platform-core-security-api-to-your-security-provider