source: trunk/grails-app/conf/SecurityConfig.groovy @ 138

Last change on this file since 138 was 138, checked in by gav, 15 years ago

Install class-diagram plugin 0.3, update the good old latex doc, set security config for class-diagram plugin.
Correct years of copyright.

File size: 3.1 KB
Line 
1security {
2
3    def authenticateService
4
5        // see DefaultSecurityConfig.groovy for all settable/overridable properties
6
7        active = true
8
9        loginUserDomainClass = "Person"
10    userName = 'loginName'
11    password = 'password'
12    enabled = 'isActive'
13
14        authorityDomainClass = "Authority"
15
16    //Required if we want to run "grails generate-manager"
17    //Which recreates the controller and views, so save the views!
18//     requestMapClass = 'Requestmap'
19
20    useRequestMapDomainClass = false
21    useControllerAnnotations = true
22
23    //Set true especially if used across the internet.
24    forceHttps = 'false'
25
26    //Pessimistic locking, deny access to all URLs that don't
27    //have an applicable URL-Role configuration.
28    //This forces us to set an annotation, static rule or
29    //extend BaseController and prevents accidentally leaving pages open.
30    controllerAnnotationsRejectIfNoRule = true
31   
32    //Static rules for controllers, actions and urls.
33    //Since we are using pessimistic locking we have to set some things
34    //here but most security should be set in the controllers.
35    controllerAnnotationStaticRules = [
36    '/': ['IS_AUTHENTICATED_FULLY'],
37    '/index.gsp': ['IS_AUTHENTICATED_FULLY'],
38    '/css/*': ['IS_AUTHENTICATED_ANONYMOUSLY'],
39    '/images/**': ['IS_AUTHENTICATED_ANONYMOUSLY'],
40    '/js/**': ['IS_AUTHENTICATED_ANONYMOUSLY'],
41    '/plugins/help-balloons-1.2/**': ['IS_AUTHENTICATED_FULLY'],
42     '/plugins/richui-0.6/**': ['IS_AUTHENTICATED_FULLY'],
43     '/plugins/class-diagram-0.3/**': ['IS_AUTHENTICATED_FULLY'],
44    '/classDiagram/**': ['IS_AUTHENTICATED_FULLY'],
45    '/login*': ['IS_AUTHENTICATED_ANONYMOUSLY'],
46    '/login/**': ['IS_AUTHENTICATED_ANONYMOUSLY'],
47    '/logout*': ['IS_AUTHENTICATED_FULLY'],
48    '/logout/**': ['IS_AUTHENTICATED_FULLY']
49    ]
50
51    //We always want to go to the home page so that bookmarks are not used.
52    defaultTargetUrl = '/appCore/welcome'
53    alwaysUseDefaultTargetUrl = true
54
55    //User caching, turned this off so that password changes take effect.
56    //It would appear that user is still in the session as logout/login
57    // is still required for role changes to take effect.
58    //If this option causes high database load try:
59    //  import org.acegisecurity.providers.dao.DaoAuthenticationProvider
60    //  import org.acegisecurity.context.SecurityContextHolder
61    //  DaoAuthenticationProvider daoAuthenticationProvider
62    //  def user = SecurityContextHolder.context.authentication.principal.username
63    //  daoAuthenticationProvider.userCache.removeUserFromCache(user)
64    //  in logout controller and perhaps on password change and role change.
65    cacheUsers = false
66
67//    //List for and events and run the closure(s) that follow.
68//    //Unfortunately the session is not available yet so many things can't be done here, us an defaultTargetUrl and controller.
69//    useSecurityEventListener = true
70//
71//    onAuthenticationSuccessEvent = { e, appCtx ->
72//        def p = e.source.principal
73//        def personInstance = Person.findByLoginName(p.username)
74//        println p.username
75//        println personInstance.loginName
76//        println personInstance.firstName
77//    }
78
79}
Note: See TracBrowser for help on using the repository browser.