common/selectors.py
branch3.0
changeset 431 18b4dd650ef8
parent 430 6fbc0ab79a2d
child 446 3a3ab6bbccc5
equal deleted inserted replaced
430:6fbc0ab79a2d 431:18b4dd650ef8
    47 from cubicweb import Unauthorized, NoSelectableObject, role
    47 from cubicweb import Unauthorized, NoSelectableObject, role
    48 from cubicweb.cwvreg import DummyCursorError
    48 from cubicweb.cwvreg import DummyCursorError
    49 from cubicweb.vregistry import chainall, chainfirst, NoSelectableObject
    49 from cubicweb.vregistry import chainall, chainfirst, NoSelectableObject
    50 from cubicweb.cwconfig import CubicWebConfiguration
    50 from cubicweb.cwconfig import CubicWebConfiguration
    51 from cubicweb.schema import split_expression
    51 from cubicweb.schema import split_expression
    52 
       
    53 
    52 
    54 # helpers for debugging selectors
    53 # helpers for debugging selectors
    55 SELECTOR_LOGGER = logging.getLogger('cubicweb.selectors')
    54 SELECTOR_LOGGER = logging.getLogger('cubicweb.selectors')
    56 TRACED_OIDS = ()
    55 TRACED_OIDS = ()
    57 
    56 
   221 anonymous_selector = deprecated_function(anonymous_user)
   220 anonymous_selector = deprecated_function(anonymous_user)
   222 
   221 
   223 @lltrace
   222 @lltrace
   224 def authenticated_user(cls, req, *args, **kwargs):
   223 def authenticated_user(cls, req, *args, **kwargs):
   225     """accept if user is authenticated"""
   224     """accept if user is authenticated"""
   226     return not anonymous_selector(cls, req, *args, **kwargs)
   225     return not anonymous_user(cls, req, *args, **kwargs)
   227 not_anonymous_selector = deprecated_function(authenticated_user)
   226 not_anonymous_selector = deprecated_function(authenticated_user)
   228 
   227 
   229 @lltrace
   228 @lltrace
   230 def match_form_params(cls, req, *args, **kwargs):
   229 def match_form_params(cls, req, *args, **kwargs):
   231     """check if parameters specified by the form_params attribute on
   230     """check if parameters specified by the form_params attribute on