View | Details | Raw Unified | Return to bug 52361
Collapse All | Expand All

(-)a/management/univention-management-console/src/univention/management/console/acl.py (-5 / +9 lines)
 Lines 138-149   class ACLs(object): Link Here 
138
138
139
	def __init__(self, ldap_base=None, acls=None):
139
	def __init__(self, ldap_base=None, acls=None):
140
		self.__ldap_base = ldap_base
140
		self.__ldap_base = ldap_base
141
		# the main acl dict
141
		self.reload()
142
		if acls is None:
142
		if acls:
143
			self.acls = []
144
		else:
145
			self.acls = [Rule(x) for x in acls]
143
			self.acls = [Rule(x) for x in acls]
146
144
145
	def reload(self):
146
		self.acls = []
147
147
	def _expand_hostlist(self, hostlist):
148
	def _expand_hostlist(self, hostlist):
148
		hosts = []
149
		hosts = []
149
		if self.__ldap_base is None:
150
		if self.__ldap_base is None:
 Lines 359-367   class LDAP_ACLs(ACLs): Link Here 
359
	FROM_GROUP = False
360
	FROM_GROUP = False
360
361
361
	def __init__(self, lo, username, ldap_base):
362
	def __init__(self, lo, username, ldap_base):
362
		ACLs.__init__(self, ldap_base)
363
		self.lo = lo
363
		self.lo = lo
364
		self.username = username
364
		self.username = username
365
		ACLs.__init__(self, ldap_base)
366
367
	def reload(self):
368
		super(LDAP_ACLs, self).reload()
365
369
366
		if self.lo:
370
		if self.lo:
367
			self._read_from_ldap()
371
			self._read_from_ldap()
(-)a/management/univention-management-console/src/univention/management/console/protocol/session.py (-14 / +10 lines)
 Lines 173-192   class ProcessorBase(Base): Link Here 
173
		self._password = password
173
		self._password = password
174
		self.auth_type = auth_type
174
		self.auth_type = auth_type
175
		self._search_user_dn()
175
		self._search_user_dn()
176
		self._reload_acls_and_permitted_commands()
176
		try:
177
			if self.acls is None:
178
				self.acls = LDAP_ACLs(self.lo, self._username, ucr['ldap/base'])
179
			self._reload_acls_and_permitted_commands()
180
		except (ldap.LDAPError, udm_errors.ldapError):
181
			reset_ldap_connection_cache(self.lo)
182
			raise
177
		self.update_module_passwords()
183
		self.update_module_passwords()
178
184
179
	def _reload_acls_and_permitted_commands(self):
185
	def _reload_acls_and_permitted_commands(self):
180
		self._reload_acls()
186
		self.acls.reload()
181
		self.__command_list = moduleManager.permitted_commands(ucr['hostname'], self.acls)
187
		self.__command_list = moduleManager.permitted_commands(ucr['hostname'], self.acls)
182
188
183
	def _reload_acls(self):
184
		try:
185
			self.acls = LDAP_ACLs(self.lo, self._username, ucr['ldap/base'])
186
		except (ldap.LDAPError, udm_errors.ldapError):
187
			reset_ldap_connection_cache()
188
			raise
189
190
	def _reload_i18n(self):
189
	def _reload_i18n(self):
191
		self.i18n.set_locale(str(self.i18n.locale))
190
		self.i18n.set_locale(str(self.i18n.locale))
192
191
 Lines 931-946   class SessionHandler(ProcessorBase): Link Here 
931
		self.authenticated = False
930
		self.authenticated = False
932
		self.__credentials = None
931
		self.__credentials = None
933
		self.__locale = None
932
		self.__locale = None
933
		# All unauthenticated requests are passed here. We need to set empty ACL's
934
		self.acls = ACLs()
934
		self._reload_acls_and_permitted_commands()
935
		self._reload_acls_and_permitted_commands()
935
936
936
	def has_active_module_processes(self):
937
	def has_active_module_processes(self):
937
		if self.processor:
938
		if self.processor:
938
			return self.processor._ProcessorBase__processes
939
			return self.processor._ProcessorBase__processes
939
940
940
	def _reload_acls(self):
941
		"""All unauthenticated requests are passed here. We need to set empty ACL's"""
942
		self.acls = ACLs()
943
944
	def error_handling(self, etype, exc, etraceback):
941
	def error_handling(self, etype, exc, etraceback):
945
		super(SessionHandler, self).error_handling(etype, exc, etraceback)
942
		super(SessionHandler, self).error_handling(etype, exc, etraceback)
946
		# make sure that the UMC login dialog is shown if e.g. restarting the UMC-Server during active sessions
943
		# make sure that the UMC login dialog is shown if e.g. restarting the UMC-Server during active sessions
947
- 

Return to bug 52361