1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-11-22 09:24:21 +01:00

adding loading roles and attributes

This commit is contained in:
kakwa 2015-05-18 20:04:47 +02:00
parent d6bb5c38ed
commit 2ba56128ac
2 changed files with 12 additions and 4 deletions

View File

@ -16,6 +16,8 @@ from operator import itemgetter
from socket import error as socket_error from socket import error as socket_error
from exceptions import * from exceptions import *
from ldapcherry.roles import Roles
from ldapcherry.attributes import Attributes
#cherrypy http framework imports #cherrypy http framework imports
import cherrypy import cherrypy
@ -165,6 +167,12 @@ class LdapCherry(object):
#auth = __import__(auth_module, globals(), locals(), ['Auth'], -1) #auth = __import__(auth_module, globals(), locals(), ['Auth'], -1)
#self.auth = auth.Auth(config['auth'], cherrypy.log) #self.auth = auth.Auth(config['auth'], cherrypy.log)
self.roles_file = self._get_param('roles', 'roles.file', config)
self.roles = Roles(self.roles_file)
self.attributes_file = self._get_param('attributes', 'attributes.file', config)
self.roles = Attributes(self.attributes_file)
except Exception as e: except Exception as e:
self._handle_exception(e) self._handle_exception(e)
exit(1) exit(1)

View File

@ -57,12 +57,12 @@ tools.sessions.timeout = 10
[attributes] [attributes]
# file discribing form content # file discribing form content
attributes.file = '/etc/ldapcherry/attributes.yml' attributes.file = './tests/cfg/attributes.yml'
[roles] [roles]
# file listing roles # file listing roles
roles.file = '/etc/ldapcherry/roles.yml' roles.file = './tests/cfg/roles.yml'
[backends] [backends]
@ -96,8 +96,8 @@ auth.mode = 'or'
# resources parameters # resources parameters
[resources] [resources]
# templates directory # templates directory
templates.dir = '/usr/share/ldapcherry/templates/' templates.dir = './resources/templates/'
[/static] [/static]
tools.staticdir.on = True tools.staticdir.on = True
tools.staticdir.dir = '/usr/share/ldapcherry/static/' tools.staticdir.dir = './resources/static/'