Changeset 354 for branches

Show
Ignore:
Timestamp:
07/21/06 02:14:17 (6 years ago)
Author:
winfried
Message:

removed dependency on pythonpath, made starting and stopping of bot from intranet

Location:
branches/version_2
Files:
1 added
13 modified

Legend:

Unmodified
Added
Removed
  • branches/version_2/HelpIM/baseconfig.py

    r353 r354  
    11import ConfigParser 
    22import os 
     3import HelpIM.sharedvars 
    34 
    45default = ['/etc/HelpIM/config'] 
     
    1415 
    1516    2) 
    16     Location pointed to by the environment variable "HelpIMconfig" 
     17    Location pointed to by the environment variable "HELPIMCONFIG" 
    1718 
    1819    3) 
     
    2122    """ 
    2223    # default location for configfile 
    23     configfiles = default 
     24    cached = HelpIM.sharedvars.get("baseconfig"+section) 
     25    if cached: 
     26        return cached 
     27    else: 
     28        configfiles = default 
    2429 
    25     env = os.environ.get("HelpIMconfig") 
    26     if env: 
    27         configfiles.append(env) 
     30        env = os.environ.get("HELPIMCONFIG") 
     31        if env: 
     32            configfiles.append(env) 
    2833 
    29     try: 
    30         # To-Do: dit gaat niet werken, de variabelen komen uit de request 
    31         # dus moet de handler via global hier een variable zetten die hier 
    32         # opgevangen kan worden. (Hmmm, dit kan op meer plaatsen gebruikt 
    33         # worden). 
    34         opts = apache.get_options() 
    35         configfiles.append(opts['HelpIMconfig']) 
    36     except (ImportError, KeyError, AttributeError): 
    37         pass 
     34        HelpIMconfig = HelpIM.sharedvars.get('HelpIMconfig') 
     35        if HelpIMconfig and not HelpIMconfig in configfiles: 
     36                configfiles.append(HelpIMconfig) 
    3837 
    39     # read configfiles and get parameters 
    40     config = ConfigParser.SafeConfigParser() 
    41     config.read(configfiles) 
    42     parms = {} 
    43     items = config.options(section) 
    44     for item in items: 
    45         parms[item] = config.get(section, item) 
    46     return parms 
     38        # from mod_python import apache 
     39        # apache.log_error("baseconfig: " + str(configfiles)) 
     40 
     41        # read configfiles and get parameters 
     42        config = ConfigParser.SafeConfigParser() 
     43        config.read(configfiles) 
     44        parms = {} 
     45        try: 
     46            items = config.options(section) 
     47        except ConfigParser.NoSectionError: 
     48            raise Exception ("Configfile not found") 
     49        for item in items: 
     50            parms[item] = config.get(section, item) 
     51        HelpIM.sharedvars.set("baseconfig"+section, parms) 
     52        return parms 
  • branches/version_2/HelpIM/bot/bot.py

    r353 r354  
    88import os 
    99 
     10# hack for local testing 
     11sys.path.append("/home/wt/werk/HelpIM/svn/branches/version_2") 
     12 
    1013from pyxmpp.all import * 
    1114from pyxmpp.jabber.client import JabberClient 
     
    1316from pyxmpp.streambase import FatalStreamError 
    1417 
    15 import HelpIM.settings 
    16 import HelpIM.bot.handlers 
    17 import HelpIM.users 
    18  
    19 import HelpIM.logger 
    20 import logging 
    21  
    22 log = logging.getLogger('HelpIM.chatbot') 
    23 logger = log # make logger object for pyxmpp 
    24  
    25 # temporary for testing 
    26 pidfile = '/tmp/HelpIMbot.pid' 
     18import HelpIM.sharedvars 
     19import HelpIM.baseconfig 
     20 
     21pidfile = '' 
    2722 
    2823class Exit(Exception): 
     
    170165 
    171166def start(): 
     167    global log 
     168    global logger 
     169    import HelpIM.settings 
     170    import HelpIM.bot.handlers 
     171    import HelpIM.users 
     172 
     173    import HelpIM.logger 
     174    import logging 
     175 
     176    log = logging.getLogger('HelpIM.chatbot') 
     177    logger = log # make logger object for pyxmpp 
    172178 
    173179    def cleanup(): 
     
    252258 
    253259def startdeamon(): 
     260    global pidfile 
     261    pidfile = HelpIM.baseconfig.get('bot')['pidfile'] 
    254262    # read pidfile 
    255263    try: 
     
    285293    # Whe are now detachted, make ourselves proces leader and 
    286294    # make shure no pipes are left open: 
     295    if (os.sysconf_names.has_key("SC_OPEN_MAX")): 
     296        maxfd = os.sysconf("SC_OPEN_MAX") 
     297    else: 
     298        maxfd = 1024 
     299    for fd in range(0, maxfd): 
     300        try: 
     301            os.close(fd) 
     302        except OSError: # ERROR, fd wasn't open to begin with (ignored) 
     303            pass 
     304 
    287305    os.setpgrp() 
    288306    sys.stdin.close() 
     
    302320 
    303321if __name__ == '__main__': 
     322    try: 
     323        HelpIM.sharedvars.set('HelpIMconfig', sys.argv[1]) 
     324    except IndexError: 
     325        pass 
    304326    startdeamon() 
  • branches/version_2/HelpIM/chatdb.py

    r347 r354  
    320320                session[prop['property']] = prop['valuetimestamp'] 
    321321            else: 
    322                 session[prop['property']] = prop['valuetext'] 
     322                if prop['valuetext']: 
     323                    session[prop['property']] = prop['valuetext'] 
     324                else: 
     325                    session[prop['property']] = prop['valueid'] 
    323326            if prop['property'] in ['staff', 'division']: 
    324327                session[prop['property']+'_id'] = int(prop['valueid']) 
  • branches/version_2/HelpIM/database.py

    r353 r354  
    104104        return 'param(%r)' % (self.value,) 
    105105 
    106  
    107 # then get the database settings and module 
    108 dbparms=HelpIM.baseconfig.get('database') 
    109  
    110  
    111 # get dbmodule 
    112 dbmod = __import__(dbparms['dbmodule']) 
    113 paramstyle = getattr(dbmod, 'paramstyle') 
    114 converter = globals()['to_' + paramstyle] 
    115  
    116 if getattr(dbmod, 'threadsafety') == 0: 
    117     raise DBModuleNotCompatibleError 
    118  
    119106class cursor: 
    120107    """Class to mimic DB-Api 2.0 cursor functions. Does not implement not 
     
    126113    def __init__(self, dict = False): 
    127114        """create an cursor object""" 
     115        #  get the database settings 
     116        dbparms=HelpIM.baseconfig.get('database') 
     117 
     118        # get dbmodule 
     119        dbmod = __import__(dbparms['dbmodule']) 
     120        paramstyle = getattr(dbmod, 'paramstyle') 
     121        self.converter = globals()['to_' + paramstyle] 
     122        if getattr(dbmod, 'threadsafety') == 0: 
     123            raise DBModuleNotCompatibleError 
     124 
    128125        # connect to dbmodule and create an cursor 
    129126        wait = 0 
     
    188185            param('%value%')) 
    189186        """ 
    190         query, params = converter(chunked_query) 
     187        query, params = self.converter(chunked_query) 
    191188        wait = 0 
    192189        while 1: 
  • branches/version_2/HelpIM/intranet/handler.py

    r352 r354  
    33""" 
    44 
    5 from mod_python import apache 
    6 import logging 
    7 import HelpIM.settings 
    8 import HelpIM.logger 
    9 import HelpIM.intranet.dispatch 
    10 import HelpIM.intranet.response 
    11  
    12 log = logging.getLogger('HelpIM.intranet') 
    13  
    14 log.info('Loading settings') 
    15 config = HelpIM.settings.get('settings', 'intranet') 
    16 config['texts'] = HelpIM.settings.get()['texts'] 
    175 
    186def handlereq(request): 
     
    208    Handles an incoming apache request. 
    219    """ 
     10    from mod_python import apache 
     11    import logging 
     12    import HelpIM.settings 
     13    import HelpIM.intranet.response 
     14    import HelpIM.sharedvars 
     15 
     16    # Try to get value of "PythonOption HelpIMconfig [path]" 
     17    # from apache configuration and make it a shared variable. 
     18    opts = request.get_options() 
     19    if opts.has_key('HelpIMconfig'): 
     20        HelpIM.sharedvars.set('HelpIMconfig', opts['HelpIMconfig']) 
     21 
     22    # setup with need the HelpIMconfig 
     23    import HelpIM.logger 
     24    import HelpIM.intranet.dispatch 
     25    log = logging.getLogger('HelpIM.intranet') 
     26    config = HelpIM.settings.get('settings', 'intranet') 
     27    config['texts'] = HelpIM.settings.get()['texts'] 
     28 
     29    # Get varibles from the apache configuration, 
     30    # use them for HelpIM too 
    2231    apacheConfig = request.get_config() 
    2332    # Don't use try / except here, it leaks memory in mod_python 3.0 
    2433    if apacheConfig.has_key('PythonDebug'): 
    25         log = logging.getLogger('HelpIM.intranet') 
    26         log.info('Reloading settings') 
    27         config = HelpIM.settings.get('settings', 'intranet') 
    28         config['texts'] = HelpIM.settings.get()['texts'] 
    2934        config['PythonDebug'] = apacheConfig['PythonDebug'] 
    3035    else: 
    31         try: 
    32             config['PythonDebug'] = None 
    33         except UnboundLocalError: 
    34             # Note: mod_python does not initialise the handler 
    35             # so we have to do it here 
    36             log = logging.getLogger('HelpIM.intranet') 
    37             log.info('Loading settings') 
    38             config = HelpIM.settings.get('settings', 'intranet') 
    39             config['texts'] = HelpIM.settings.get()['texts'] 
    40             config['PythonDebug'] = None 
     36        config['PythonDebug'] = None 
    4137         
    4238    if apacheConfig.has_key('PythonAutoReload'): 
  • branches/version_2/HelpIM/intranet/lib/startstop.py

    r340 r354  
    22 
    33import os 
     4import sys 
    45import string 
    56import socket 
     
    78import time 
    89 
    9 import HelpIM.settings 
     10import HelpIM.baseconfig 
     11import HelpIM.sharedvars 
    1012 
    11 settings = HelpIM.settings.get() 
    12 pidfile = settings['pidfile'] 
    13 command = settings['command'] 
     13pidfile = HelpIM.baseconfig.get('bot')['pidfile'] 
    1414 
     15def getrunning(pid): 
     16    try: 
     17        os.kill(pid, 0) 
     18        return True 
     19    except OSError, err: 
     20        return False 
    1521 
    1622def getpid(): 
     
    1824        pid_file=open(pidfile, 'r') 
    1925        pid=pid_file.read() 
     26        pid_file.close() 
    2027    else: 
    21         pid=None 
     28        pid=0 
    2229    return pid 
    2330 
     
    2532    pid=getpid() 
    2633    if pid: 
    27         status_message="The chatserver is running ok (pid: "+pid+")." 
    28         status=pid 
     34        if getrunning(int(pid)): 
     35            status_message="The chatserver is running ok (pid: "+pid+")." 
     36            status=pid 
     37        else: 
     38            status_message="The chatserver is not running, but pid-file exist (pid: "+pid+") Please try to stop the chatserver first" 
     39            status=pid 
    2940    else: 
    3041        status_message="The chatserver is not running." 
     
    4152        return("Can't start server: ") 
    4253    else: 
    43         os.spawnlp(os.P_NOWAIT, "python", "python", command) 
    44         return("The chatserver is starting: ") 
     54        #Find the path of the bot: 
     55        for path in sys.path: 
     56            bot = os.path.join(path, 'HelpIM/bot/bot.py') 
     57            if os.path.isfile(bot): 
     58                os.spawnl(os.P_NOWAIT, bot, 'bot.py', HelpIM.sharedvars.get('HelpIMconfig')) 
     59                return("The chatserver is starting: ") 
     60        return("Can't find server... ") 
    4561 
    4662def stop(): 
     
    6278    else: 
    6379        return("Can't stop the chatserver: ") 
    64  
    65 def restart(): 
    66     return(stop()+" "+start()) 
    67  
  • branches/version_2/HelpIM/intranet/scripts/admin.py

    r340 r354  
    33import time 
    44import HelpIM.intranet.lib.servletbase 
     5import HelpIM.intranet.lib.startstop 
     6 
    57#from lib import kindertelefoon 
    68#from lib import getsettings 
     
    2729            if section in ['', 'prefs', 'shifts', 'blocked', 'users']: 
    2830                # valid section, handle it 
    29                 reloadServer = False 
    3031 
    3132                if section == '': 
     
    3536                    action = self.requestVars.get('action') 
    3637                    if action == 'startchat': 
    37                         namespace['status'] = startstop.start() 
     38                        namespace['status'] = HelpIM.intranet.lib.startstop.start() 
    3839                    elif action == 'stopchat': 
    39                         namespace['status'] = startstop.stop() 
     40                        namespace['status'] = HelpIM.intranet.lib.startstop.stop() 
    4041                    if str(action).startswith('start') or str(action).startswith('stop'): 
    4142                        time.sleep(2) 
    4243 
    4344                    # get status 
    44                     namespace['status'] = namespace['status'] + startstop.status() 
     45                    namespace['status'] = namespace['status'] + HelpIM.intranet.lib.startstop.status() 
    4546                elif section == 'prefs': 
    4647                    # preferences section 
     
    5556                            prefs['max-queue-length'] = str(maxQueueLength) 
    5657                            getsettings.store('prefs', prefs, 'prefs') 
    57                             reloadServer = True 
    5858                        else: 
    5959                            namespace['errors'].append('invalid_max-queue-length') 
     
    9292                                int(form['length_hour'])*60+int(form['length_minute']) 
    9393                                )) 
    94                             reloadServer = True 
    9594                        for remove in removes: 
    9695                            try: 
     
    9998                            except KeyError: 
    10099                                pass 
    101                             reloadServer = True 
    102100                        getsettings.store('shifts', shifts, 'shifts') 
    103101                    namespace['shifts'] = shifts 
     
    131129                                pass 
    132130                        getsettings.store('blocked', blocked, 'blocked') 
    133                         reloadServer = True 
    134131                    namespace['blocked'] = blocked 
    135132 
     
    179176                    namespace['mode'] = mode 
    180177 
    181                 # reload the server if nessecary 
    182                 if reloadServer: 
    183                     try: 
    184                         if getsettings.reloadServer(): 
    185                             namespace['message'] = 'server_reloaded' 
    186                         else: 
    187                             namespace['message'] = 'cannot_reload_server' 
    188                     except IOError: 
    189                         namespace['message'] = 'server_not_running' 
    190  
    191178                template = 'admin.tpl' 
    192179            else: 
     
    197184            template = 'nopermission.tpl' 
    198185 
    199         tpl = inpy.fileCacheTpl( 
    200             template,  
    201             self.config['path']['templates'],  
    202             self.config['path']['templates_c'],  
    203             encoding='iso-8859-1' 
    204             ) 
    205         #tpl.clearCache(self.config['path']['templates_c']) 
    206         self.response.write(tpl.fetch(namespace).encode('iso-8859-1','ignore')) 
     186        self.writeTemplate(template, namespace) 
  • branches/version_2/HelpIM/intranet/scripts/login.py

    r328 r354  
    2323                    self.log.warn('failed login attempt: ' + form.get('username')) 
    2424                else: 
    25                     cookieHeader = "%s=%s; path=%s; domain=%s;" % ('sessid', \ 
    26                         self.session.getSessionId(), self.config['path']['base'], \ 
    27                         self.request.hostname) 
     25                    if self.request.hostname in ['localhost', '127.0.0.1']: 
     26                        cookieHeader = "%s=%s; path=%s;" % ('sessid', \ 
     27                            self.session.getSessionId(), self.config['path']['base']) 
     28                    else: 
     29                        cookieHeader = "%s=%s; path=%s; domain=%s;" % ('sessid', \ 
     30                            self.session.getSessionId(), self.config['path']['base'], \ 
     31                            self.request.hostname) 
    2832                    self.response.addHeader('Set-Cookie', cookieHeader) 
    2933                    self.log.info('login: ' + form.get('username')) 
  • branches/version_2/HelpIM/status.py

    r348 r354  
    1 """Functions for getting and setting the status of HelpIM""" 
     1"""Functions for getting and setting the status of HelpIM clients and staff""" 
    22 
    33import logging 
    44import HelpIM.database 
    55import HelpIM.settings 
    6 import HelpIM.logger 
    7  
    8 log = logging.getLogger('HelpIM') 
    96 
    107def get(jid=None, hash=None, bot=None): 
     
    6360    to place clients fallen out of the waiting-queue back in the same 
    6461    position if they reconnect.""" 
     62 
     63    # Don't initialize logging earlier: it needs the global HelpIMconfig 
     64 
     65    import HelpIM.logger 
     66    log = logging.getLogger('HelpIM') 
     67 
    6568    if not ((jid and bot) or hash): 
    6669        raise TypeError, 'jid and bot or hash needed' 
  • branches/version_2/HelpIM/webchat/handler.py

    r317 r354  
    1 import logging 
    2 import random 
    3 import time 
    4 from mod_python import apache 
    5 from Crypto.Hash import SHA256 
    6 import HelpIM.logger 
    7 import HelpIM.settings 
    8 import HelpIM.status 
    9 import HelpIM.webchat.servletbase 
     1def handlereq(req): 
     2    import logging 
     3    import random 
     4    import time 
     5    from mod_python import apache 
     6    from Crypto.Hash import SHA256 
     7    import HelpIM.status 
     8    import HelpIM.webchat.servletbase 
     9    import HelpIM.settings 
     10    import HelpIM.sharedvars 
    1011 
    11 log = logging.getLogger('HelpIM.webchat') 
    12 logger = log # make logger object for pyxmpp 
     12    rangen = random.Random() 
     13    rangen.seed() 
    1314 
    14 rangen = random.Random() 
    15 rangen.seed() 
     15    ERROR_HEADER = """<html> 
     16        <head> 
     17            <title>Error</title> 
     18            <style> 
     19            p 
     20            { 
     21                border:     1px solid #ff6600; 
     22                background: #ffcc00; 
     23                padding:    1em; 
     24            } 
     25            </style> 
     26        </head> 
     27        <body> 
     28            <p> 
     29    """ 
    1630 
    17 ERROR_HEADER = """<html> 
    18     <head> 
    19         <title>Error</title> 
    20         <style> 
    21         p 
    22         { 
    23             border:     1px solid #ff6600; 
    24             background: #ffcc00; 
    25             padding:    1em; 
    26         } 
    27         </style> 
    28     </head> 
    29     <body> 
    30         <p> 
    31 """ 
     31    ERROR_FOOTER = """ 
     32            </p> 
     33        </body> 
     34    </html> 
     35    """ 
     36    def newhash(): 
     37        # Generate from time and a random number a string to generate the 
     38        # hash from. This makes sure the hash is unique and not guessable: 
     39        string = str(time.time())+str(rangen.random()) 
     40        hash = SHA256.new(string).hexdigest() 
     41        return hash 
    3242 
    33 ERROR_FOOTER = """ 
    34         </p> 
    35     </body> 
    36 </html> 
    37 """ 
     43    # Try to get value of "PythonOption HelpIMconfig [path]" 
     44    # from apache configuration and make it a shared variable. 
     45    opts = req.get_options() 
     46    if opts.has_key('HelpIMconfig'): 
     47        HelpIM.sharedvars.set('HelpIMconfig', opts['HelpIMconfig']) 
    3848 
     49    # initiate logging, it needs the shared variable HelpIMconfig 
     50    import HelpIM.logger 
     51    log = logging.getLogger('HelpIM.webchat') 
     52    logger = log # make logger object for pyxmpp 
    3953 
    40 def newhash(): 
    41     # Generate from time and a random number a string to generate the 
    42     # hash from. This makes sure the hash is unique and not guessable: 
    43     string = str(time.time())+str(rangen.random()) 
    44     hash = SHA256.new(string).hexdigest() 
    45     return hash 
    46  
    47 def handlereq(req): 
     54    # Get varibles from the apache configuration, 
     55    # use them for HelpIM too 
    4856    apacheConfig = req.get_config() 
    4957    # Don't use try / except here, it leaks memory in mod_python 3.0 
  • branches/version_2/settings/config.example

    r353 r354  
    1919 
    2020[bot] 
    21 pidfile=/var/run/HelpIMbot 
     21pidfile=/home/wt/werk/HelpIM/svn/branches/version_2/test/HelpIMbot 
    2222[database] 
    2323dbmodule=MySQLdb 
  • branches/version_2/settings/settings_all_example.py

    r353 r354  
    1616 
    1717settings = { 
    18     'command': '/home/wt/werk/HelpIM/svn/branches/version_2/settings/start_chat2.sh', 
    19     'pidfile':  '/home/wt/werk/HelpIM/svn/branches/version_2/test/chatbot.pid', 
    2018    'logging': { 
    2119        # Valid levels are (from verbose to less verbose): DEBUG, INFO, WARN, ERROR, CRITICAL 
  • branches/version_2/settings/settings_intranet_example.py

    r326 r354  
    1717settings = { 
    1818            u'path': { 
    19                 u'templates':   u'/disk/web/oefenchat.soshulp.nl/HelpIM/templates', 
    20                 u'templates_c': u'/disk/web/oefenchat.soshulp.nl/HelpIM/templates_c', 
    21                 u'base':        u'', 
     19                u'templates':   u'/home/wt/werk/HelpIM/svn/branches/version_2/settings/templates', 
     20                u'templates_c': u'/home/wt/werk/HelpIM/svn/branches/version_2/test/templates_c', 
     21                u'base':        u'/intranet', 
    2222                u'protocol':    u'http' 
    2323                }, 
     
    3333                'volunteer':        'vrijwilliger', 
    3434                'coordinator':      'coordinator', 
    35                 'administrator':    'beheerder'}, 
     35                'administrator':    'beheerder', 
     36                'testgroup':        'tester'}, 
    3637            u'pages': { 
    3738                # for each callable script ( baseuri+'/'+script ) the script it links to, the following 
     
    4950                    u'script':      u'HelpIM.intranet.scripts.admin', 
    5051                    u'name':        u'Beheer', 
    51                     u'navigation':  ['administrator'], 
    52                     u'view':        ['administrator'] 
     52                    u'navigation':  ['administrator', 'testgroup'], 
     53                    u'view':        ['administrator', 'testgroup'] 
    5354                    }, 
    5455                u'chatsession': { 
     
    5657                    u'name':        u'Gesprek', 
    5758                    u'navigation':  [], 
    58                     u'view':        ['administrator', 'coordinator', 'volunteer'], 
    59                     u'view_all':    ['administrator'], 
     59                    u'view':        ['administrator', 'testgroup', 'coordinator', 'volunteer'], 
     60                    u'view_all':    ['administrator', 'testgroup'], 
    6061                    u'view_division': ['coordinator'], 
    6162                    u'view_own':    ['volunteer'], 
     
    7980                    u'script':      u'HelpIM.intranet.scripts.stats', 
    8081                    u'name':        u'Stats', 
    81                     u'navigation':  ['administrator'], 
    82                     u'view':        ['administrator'] 
     82                    u'navigation':  ['administrator', 'testgroup'], 
     83                    u'view':        ['administrator', 'testgroup'] 
    8384                    }, 
    8485                u'': { 
    8586                    u'script':      u'HelpIM.intranet.scripts.page', 
    8687                    u'name':        u'Nieuws', 
    87                     u'navigation':  ['administrator', 'coordinator', 'volunteer'], 
    88                     u'view':        ['administrator', 'coordinator', 'volunteer'], 
    89                     u'edit':        ['administrator'], 
     88                    u'navigation':  ['administrator', 'testgroup', 'coordinator', 'volunteer'], 
     89                    u'view':        ['administrator', 'testgroup', 'coordinator', 'volunteer'], 
     90                    u'edit':        ['administrator', 'testgroup'], 
    9091                    u'subnav':      [['', 'landelijk nieuws'], ['divisionnews', 'regionaal nieuws']], 
    9192                    u'division':    False 
     
    9596                    u'name':        u'Nieuws', 
    9697                    u'navigation':  [], 
    97                     u'view':        ['administrator', 'coordinator', 'volunteer'], 
     98                    u'view':        ['administrator', 'testgroup', 'coordinator', 'volunteer'], 
    9899                    u'edit':        ['coordinator'], 
    99100                    u'subnav':      [['', 'landelijk nieuws'], ['divisionnews', 'regionaal nieuws']], 
     
    103104                    u'script':      u'HelpIM.intranet.scripts.chatsessions', 
    104105                    u'name':        u'Gesprekken', 
    105                     u'navigation':  ['administrator', 'coordinator', 'volunteer'], 
    106                     u'view':        ['administrator', 'coordinator', 'volunteer'], 
    107                     u'view_all':    ['administrator'], 
     106                    u'navigation':  ['administrator', 'testgroup', 'coordinator', 'volunteer'], 
     107                    u'view':        ['administrator', 'testgroup', 'coordinator', 'volunteer'], 
     108                    u'view_all':    ['administrator', 'testgroup'], 
    108109                    u'view_division': ['coordinator'], 
    109110                    u'view_own':    ['volunteer'], 
     
    113114                    u'script':      u'HelpIM.intranet.scripts.page', 
    114115                    u'name':        u'Handleiding', 
    115                     u'navigation':  ['administrator', 'coordinator', 'volunteer'], 
    116                     u'view':        ['administrator', 'coordinator', 'volunteer'], 
    117                     u'edit':        ['administrator'], 
     116                    u'navigation':  ['administrator', 'testgroup', 'coordinator', 'volunteer'], 
     117                    u'view':        ['administrator', 'testgroup', 'coordinator', 'volunteer'], 
     118                    u'edit':        ['administrator', 'testgroup'], 
    118119                    u'division':    False 
    119120                    }, 
     
    121122                    u'script':      u'HelpIM.intranet.scripts.files', 
    122123                    u'name':        u'Rooster', 
    123                     u'navigation':  ['administrator', 'coordinator', 'volunteer'], 
    124                     u'view':        ['administrator', 'coordinator', 'volunteer'], 
     124                    u'navigation':  ['administrator', 'testgroup', 'coordinator', 'volunteer'], 
     125                    u'view':        ['administrator', 'testgroup', 'coordinator', 'volunteer'], 
    125126                    u'edit':        ['coordinator', 'coordinator'], 
    126127                    u'division':    True 
     
    136137                    u'name':        u'Gebruikersgegevens', 
    137138                    u'navigation':  [], 
    138                     u'view':        ['administrator'] 
     139                    u'view':        ['administrator', 'testgroup'] 
    139140                    }, 
    140141                },