Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: Grails-Acegi 0.4.1
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
Probably can't use Spring Security's ACLs because of Hibernate. For example if a user can see an Organization and Organization has a collection of Departments, some of which the user can't see, you can't just remove the denied instances from the collection since it'll permanently remove them from the collection. Need to look at filters, which are very limited in general but might help here. Also look at using event listeners and/or an interceptor.
Another option is to use metaclass and/or AOP and throw exceptions, but that's a little harsh.
Attachments
-
$i18n.getText("admin.common.words.hide")
- grails-acegi-grails-1.2.1.zip
- 03/Mar/10 5:20 AM
- 7.15 MB
- Miguel Pastor
-
- grails-app/.svn/all-wcprops 0.1 kB
- grails-app/.svn/entries 0.3 kB
- grails-app/conf/.svn/all-wcprops 0.3 kB
- grails-app/conf/.svn/entries 0.4 kB
- grails-app/.../DefaultSecurityConfig.groovy.svn-base 6 kB
- grails-app/conf/BuildConfig.groovy 0.1 kB
- grails-app/.../DefaultSecurityConfig.groovy 6 kB
- grails-app/conf/UrlMappings.groovy 0.2 kB
- grails-app/controllers/.svn/all-wcprops 0.1 kB
- grails-app/controllers/.svn/entries 0.3 kB
- grails-app/controllers/.../.svn/all-wcprops 0.1 kB
- grails-app/controllers/org/.svn/entries 0.3 kB
- grails-app/controllers/.../.svn/all-wcprops 0.1 kB
- grails-app/controllers/org/.../.svn/entries 0.3 kB
- grails-app/controllers/.../.svn/all-wcprops 0.1 kB
- grails-app/controllers/org/.../.svn/entries 0.3 kB
- grails-app/controllers/.../.svn/all-wcprops 0.1 kB
- grails-app/controllers/org/.../.svn/entries 0.3 kB
- grails-app/controllers/.../.svn/all-wcprops 0.3 kB
- grails-app/controllers/org/.../.svn/entries 0.4 kB
- grails-app/.../AuthBase.groovy.svn-base 3 kB
- grails-app/controllers/.../AuthBase.groovy 3 kB
- grails-app/i18n/.svn/all-wcprops 0.2 kB
- grails-app/i18n/.svn/entries 0.4 kB
- grails-app/.../messages.properties.svn-base 0.0 kB
- grails-app/i18n/messages.properties 0.0 kB
- grails-app/services/.svn/all-wcprops 0.1 kB
- grails-app/services/.svn/entries 0.3 kB
- grails-app/services/org/.svn/all-wcprops 0.1 kB
- grails-app/services/org/.svn/entries 0.3 kB
$i18n.getText("admin.common.words.show")- grails-acegi-grails-1.2.1.zip
- 03/Mar/10 5:20 AM
- 7.15 MB
- Miguel Pastor
-
$i18n.getText("admin.common.words.hide")
- grails-acegi-logic-acl-in-application.zip
- 17/Mar/10 4:14 PM
- 6.42 MB
- Miguel Pastor
-
- lib/.svn/all-wcprops 3 kB
- lib/.svn/entries 4 kB
- lib/.svn/.../ant-contrib-1.0b3.jar.svn-base 0.1 kB
- lib/.svn/.../aopalliance-1.0.jar.svn-base 0.1 kB
- lib/.svn/.../aspectjrt-1.5.4.jar.svn-base 0.1 kB
- lib/.../cas-client-core-3.1.1.jar.svn-base 0.1 kB
- lib/.svn/.../commons-codec-1.3.jar.svn-base 0.1 kB
- lib/.../commons-httpclient-3.0.1.jar.svn-base 0.1 kB
- lib/.svn/prop-base/easymock.jar.svn-base 0.1 kB
- lib/.../facebook-java-api-2.0.4.jar.svn-base 0.1 kB
- lib/.svn/.../htmlparser-1.6.jar.svn-base 0.1 kB
- lib/.svn/.../jcifs-1.2.25.jar.svn-base 0.1 kB
- lib/.svn/.../json-20070829.jar.svn-base 0.1 kB
- lib/.svn/.../openid4java-0.9.2.jar.svn-base 0.1 kB
- lib/.svn/.../openxri-client.jar.svn-base 0.1 kB
- lib/.svn/.../openxri-syntax.jar.svn-base 0.1 kB
- lib/.svn/.../spring-ldap-1.2.1.jar.svn-base 0.1 kB
- lib/.../spring-ldap-tiger-1.2.1.jar.svn-base 0.1 kB
- lib/.../spring-security-acl-2.0.4.jar.svn-base 0.1 kB
- lib/.../spring-security-cas-client-2.0.4.jar.svn-base 0.1 kB
- lib/.../spring-security-core-2.0.4.jar.svn-base 0.1 kB
- lib/.../spring-security-core-tiger-2.0.4.jar.svn-base 0.1 kB
- lib/.../spring-security-ntlm-2.0.4.jar.svn-base 0.1 kB
- lib/.../spring-security-openid-2.0.4.jar.svn-base 0.1 kB
- lib/.svn/.../xmlsec-1.3.0.jar.svn-base 0.1 kB
- lib/.svn/.../ant-contrib-1.0b3.jar.svn-base 219 kB
- lib/.svn/.../aopalliance-1.0.jar.svn-base 4 kB
- lib/.svn/.../aspectjrt-1.5.4.jar.svn-base 112 kB
- lib/.../cas-client-core-3.1.1.jar.svn-base 54 kB
- lib/.svn/.../commons-codec-1.3.jar.svn-base 46 kB
$i18n.getText("admin.common.words.show")- grails-acegi-logic-acl-in-application.zip
- 17/Mar/10 4:14 PM
- 6.42 MB
- Miguel Pastor
-
$i18n.getText("admin.common.words.hide")
- grails-spring-security-0.5.1.zip
- 04/Oct/09 1:04 PM
- 5.27 MB
- Phillip Merensky
-
- SpringSecurityGrailsPlugin.groovy 47 kB
- application.properties 0.1 kB
- grails-app/.../DefaultSecurityConfig.groovy 6 kB
- grails-app/controllers/.../AuthBase.groovy 3 kB
- grails-app/domain/AclClass.groovy 0.6 kB
- grails-app/domain/AclEntry.groovy 1.0 kB
- grails-app/.../AclObjectIdentity.groovy 1 kB
- grails-app/domain/AclSid.groovy 0.5 kB
- grails-app/i18n/messages.properties 3 kB
- grails-app/i18n/messages_de.properties 3 kB
- grails-app/i18n/messages_es.properties 3 kB
- grails-app/i18n/messages_fr.properties 2 kB
- grails-app/i18n/messages_it.properties 2 kB
- grails-app/i18n/messages_ja.properties 2 kB
- grails-app/i18n/messages_nl.properties 3 kB
- grails-app/.../messages_pt_BR.properties 3 kB
- grails-app/i18n/messages_ru.properties 4 kB
- grails-app/i18n/messages_th.properties 5 kB
- grails-app/.../messages_zh_CN.properties 2 kB
- grails-app/.../AuthenticateService.groovy 6 kB
- grails-app/.../LookupStrategyService.groovy 4 kB
- grails-app/taglib/.../AuthorizeTagLib.groovy 3 kB
- grails-app/views/error.gsp 2 kB
- grails-app/views/error_1.gsp 2 kB
- grails-app/views/index.gsp 0.9 kB
- grails-app/views/layouts/main.gsp 0.7 kB
- lib/ant-contrib-1.0b3.jar 219 kB
- lib/aopalliance-1.0.jar 4 kB
- lib/aspectjrt-1.6.4.jar 113 kB
- lib/cas-client-core-3.1.1.jar 54 kB
$i18n.getText("admin.common.words.show")- grails-spring-security-0.5.1.zip
- 04/Oct/09 1:04 PM
- 5.27 MB
- Phillip Merensky
Activity
I am very interested in leveraging this work.
Have there been any further developments?
Thanks
John
Please see http://burtbeckwith.com/blog/?p=287 for a writeup and download of an updated plugin based on work I did integrated with Phillip's work.
Hi guys,
Are you still working on it? I have added ACL support to grails-acegi some time ago.
I attach my approach (i am still working on it but it is working on Grails 1.2.1 ).
I would like to help/contribute yours on building an stable version.
Regards,
Migue
PD: Sorry about my english ![]()
Hi again guys,
I was thinking that would be nice if ACL logic creation were in the application and not in the plugin. (i consider this logic is application specific). The application i am developing currently creates three different ACL on every domain entity to protect:
- an ACL to authorize the owner (really the company of the user) of the object
- an ACL to authorize a specific ROLE (ROLE_ANALYST)
- an ACL to authorize another specific ROLE (ROLE_ADMIN)
Two different approach have come to my mind (i have implemented the two):
- Two closures defined on SecurityConfig. This closures will be injected on domain class events (beforeDelete and afterInsert). On this way we leverage the specific logic ACL creation to the application.
- By convention, the application defines a bean with to methods (established by convention too). In this case, the injected code would retrieve the bean from the context and execute the methods on the bean configured by the application.
Additionally, i have modified the plugin in order to allow a configurable class SID (actually it uses PrincipalSid). This is a nice feature in multitenant environments where company is really the owner of the objects (in my current application all users in a company have read/write access to all objects in it)
I attach a project with the code.
Regards,
Migue
- an ACL to authorize the owner (really the company of the user) of the object
- an ACL to authorize a specific ROLE (ROLE_ANALYST)
- an ACL to authorize another specific ROLE (ROLE_ADMIN)
- Two closures defined on SecurityConfig. This closures will be injected on domain class events (beforeDelete and afterInsert). On this way we leverage the specific logic ACL creation to the application.
- By convention, the application defines a bean with to methods (established by convention too). In this case, the injected code would retrieve the bean from the context and execute the methods on the bean configured by the application.
Hello Burt and others.
I attached my implementation (based on Stephan February's work for plugin version 0.3) of Spring Security ACLs within the acegi plugin 0.5.1. To prevent naming confusions I renamed the plugin to spring-security plugin.
A brief description of the functionality and configuration possibilities can be found here
http://imagesiteproject.wordpress.com/2009/09/24/integration-of-spring-security-into-grails-plugin-approach-3/ .
The plugin should work as expected apart from the three following known issues:
If questions remain, feel free to contact me. However, as I am quite busy at the moment, answers may take some time.
Hope this helps somebody
Regards,
Phillip
- Access denied exception is not correctly wrapped at the moment although AccessDeniedHandler is configured (This however can be solved in userspace with a custom error page)
- 'grails run-app' does not work with security calls, 'grails run-war' does
- When using MySQL, InnoDB dialect must be configured
If questions remain, feel free to contact me. However, as I am quite busy at the moment, answers may take some time. Hope this helps somebody Regards, Phillip