Mercurial > kallithea
comparison pylons_app/config/environment.py @ 239:b18f89d6d17f
Adde draft for permissions systems, made all needed decorators, and checks. For future usage in the system.
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 30 May 2010 19:49:40 +0200 |
parents | 5e2470ebdbc6 |
children | 3782a6d698af |
comparison
equal
deleted
inserted
replaced
238:a55c17874486 | 239:b18f89d6d17f |
---|---|
1 """Pylons environment configuration""" | 1 """Pylons environment configuration""" |
2 import logging | |
3 import os | |
4 | |
5 from mako.lookup import TemplateLookup | 2 from mako.lookup import TemplateLookup |
6 from pylons.configuration import PylonsConfig | 3 from pylons.configuration import PylonsConfig |
7 from pylons.error import handle_mako_error | 4 from pylons.error import handle_mako_error |
5 from pylons_app.config.routing import make_map | |
6 from pylons_app.lib.auth import set_available_permissions | |
7 from pylons_app.model import init_model | |
8 from sqlalchemy import engine_from_config | 8 from sqlalchemy import engine_from_config |
9 | 9 import logging |
10 import os | |
10 import pylons_app.lib.app_globals as app_globals | 11 import pylons_app.lib.app_globals as app_globals |
11 import pylons_app.lib.helpers | 12 import pylons_app.lib.helpers |
12 from pylons_app.config.routing import make_map | 13 |
13 from pylons_app.model import init_model | 14 |
14 | 15 |
15 log = logging.getLogger(__name__) | 16 log = logging.getLogger(__name__) |
16 | 17 |
17 def load_environment(global_conf, app_conf): | 18 def load_environment(global_conf, app_conf): |
18 """Configure the Pylons environment via the ``pylons.config`` | 19 """Configure the Pylons environment via the ``pylons.config`` |
60 else: | 61 else: |
61 sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.') | 62 sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.') |
62 | 63 |
63 init_model(sa_engine_db1) | 64 init_model(sa_engine_db1) |
64 | 65 |
66 set_available_permissions(config) | |
65 # CONFIGURATION OPTIONS HERE (note: all config options will override | 67 # CONFIGURATION OPTIONS HERE (note: all config options will override |
66 # any Pylons config options) | 68 # any Pylons config options) |
67 | 69 |
68 return config | 70 return config |