server/serverconfig.py
branchstable
changeset 4756 a2c73b272c9b
parent 4719 aaed3f813ef8
child 4834 b718626a0e60
equal deleted inserted replaced
4755:13a5d3a7410e 4756:a2c73b272c9b
   183     bootstrap_schema = True
   183     bootstrap_schema = True
   184 
   184 
   185     # check user's state at login time
   185     # check user's state at login time
   186     consider_user_state = True
   186     consider_user_state = True
   187 
   187 
       
   188     # XXX hooks control stuff should probably be on the session, not on the config
       
   189 
   188     # hooks activation configuration
   190     # hooks activation configuration
   189     # all hooks should be activated during normal execution
   191     # all hooks should be activated during normal execution
   190     disabled_hooks_categories = set()
   192     disabled_hooks_categories = set()
   191     enabled_hooks_categories = set()
   193     enabled_hooks_categories = set()
   192     ALLOW_ALL = object()
   194     ALLOW_ALL = object()
   230                     changes.add(category)
   232                     changes.add(category)
   231         return changes
   233         return changes
   232 
   234 
   233     @classmethod
   235     @classmethod
   234     def is_hook_activated(cls, hook):
   236     def is_hook_activated(cls, hook):
       
   237         return cls.is_hook_category_activated(hook.category)
       
   238 
       
   239     @classmethod
       
   240     def is_hook_category_activated(cls, category):
   235         if cls.hooks_mode is cls.DENY_ALL:
   241         if cls.hooks_mode is cls.DENY_ALL:
   236             return hook.category in cls.enabled_hooks_categories
   242             return category in cls.enabled_hooks_categories
   237         return hook.category not in cls.disabled_hooks_categories
   243         return category not in cls.disabled_hooks_categories
   238 
   244 
   239     # should some hooks be deactivated during [pre|post]create script execution
   245     # should some hooks be deactivated during [pre|post]create script execution
   240     free_wheel = False
   246     free_wheel = False
   241 
   247 
   242     # list of enables sources when sources restriction is necessary
   248     # list of enables sources when sources restriction is necessary