server/session.py
changeset 9479 f13fbab0c718
parent 9478 2d7521881d3d
child 9482 5b97e69f9c29
equal deleted inserted replaced
9478:2d7521881d3d 9479:f13fbab0c718
  1768 class InternalManager(object):
  1768 class InternalManager(object):
  1769     """a manager user with all access rights used internally for task such as
  1769     """a manager user with all access rights used internally for task such as
  1770     bootstrapping the repository or creating regular users according to
  1770     bootstrapping the repository or creating regular users according to
  1771     repository content
  1771     repository content
  1772     """
  1772     """
  1773     def __init__(self):
  1773     def __init__(self, lang='en'):
  1774         self.eid = -1
  1774         self.eid = -1
  1775         self.login = u'__internal_manager__'
  1775         self.login = u'__internal_manager__'
  1776         self.properties = {}
  1776         self.properties = {}
  1777         self.groups = set(['managers'])
  1777         self.groups = set(['managers'])
       
  1778         self.lang = lang
  1778 
  1779 
  1779     def matching_groups(self, groups):
  1780     def matching_groups(self, groups):
  1780         return 1
  1781         return 1
  1781 
  1782 
  1782     def is_in_group(self, group):
  1783     def is_in_group(self, group):
  1785     def owns(self, eid):
  1786     def owns(self, eid):
  1786         return True
  1787         return True
  1787 
  1788 
  1788     def property_value(self, key):
  1789     def property_value(self, key):
  1789         if key == 'ui.language':
  1790         if key == 'ui.language':
  1790             return 'en'
  1791             return self.lang
  1791         return None
  1792         return None
  1792 
  1793 
  1793     def prefered_language(self, language=None):
  1794     def prefered_language(self, language=None):
  1794         # mock CWUser.prefered_language, mainly for testing purpose
  1795         # mock CWUser.prefered_language, mainly for testing purpose
  1795         return self.property_value('ui.language')
  1796         return self.property_value('ui.language')