grails - 使用Spring Security限制对Grails中的域类gorm方法的访问

标签 grails spring-security gorm acl

是否可以使用Spring Security定义对GORM方法(例如保存,删除,更新)的访问?

我看过ACL的插件文档,但是,尽管我认为该插件允许我定义访问权限,但我不清楚如何做到这一点。

ACL的文件:http://burtbeckwith.github.com/grails-spring-security-acl/docs/manual/guide/single.pdf

注意:文档中的示例分别定义对类实例的访问。我想在类里面定义它们。

最佳答案

不知道如何用grails准确地做,但是您应该为域对象写安全的切入点

 <global-method-security pre-post-annotations="enabled">
     <!-- Block anything ending with the word 'Controller'-->
     <protect-pointcut expression="execution(* my.pkg.*Domain.*(..))" access="NON_EXISTANT_ROLE"/>
 </global-method-security>

关于grails - 使用Spring Security限制对Grails中的域类gorm方法的访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12047664/

相关文章:

java - 基于 Spring mvc Java 的配置不起作用。控制台显示没有错误,但我的 jsp 页面没有显示

在所有级别的身份验证中使用 X509 的 Spring Security

Grails 异常,可能与 NoClassDefFoundError/BuildableCriteria 相关的依赖关系

exception - 同时以错误级别记录每个异常

Springboot :BeanDefinitionStoreException: Failed to parse configuration class

mongodb - 使用Grails的MongoDB WildCard查询花费太多时间

grails - hasMany没有获取记录

grails - 在grails域中具有通用的belongsTo

grails - 自定义 g :paginate to Prepend "Page x of y"

grails - 在Grails taglib中获取动态Config参数的问题