source: trunk/grails-app/services/AuthorizationService.groovy @ 17

Last change on this file since 17 was 15, checked in by duh, 14 years ago

-added initial implementation of authorization code

  • Property svn:keywords set to Date Author Rev
File size: 824 bytes
Line 
1/**
2 * Authentication and Authorization service
3 * @Author  Jeroen Wesbeek
4 * @Since   20091019
5 *
6 * Revision information:
7 * $Rev: 15 $
8 * $Author: gajula $
9 * $Date: 2009-10-21 11:04:41 +0000 (wo, 21 okt 2009) $
10 */
11public class AuthorizationService {
12    /**
13     * class constructor
14     * @void
15     */
16    public def AuthorizationService() {
17        // debug line for now
18        printf("instantiated %s\n",this.class.name);
19    }
20
21    /**
22     * check if a user is authenticated to use this class and / or method
23     * @return boolean
24     */
25    public def isAuthorized(controller,action) {
26        // logic should be implemented here containing:
27        //      user / sessions
28        //      user authorization per controller + action
29        // another method should be able to list authorized actions?
30        printf("calling isAuthorized(%s,%s)\n",controller,action);
31
32        // everything is allowed for now...
33        return true;
34    }
35}
Note: See TracBrowser for help on using the repository browser.