diff -r 1af69779f597 -r c342531032a1 selectors.py --- a/selectors.py Fri May 07 16:50:09 2010 +0200 +++ b/selectors.py Fri May 07 20:07:54 2010 +0200 @@ -689,6 +689,16 @@ return rset and self.match_expected(len(rset.column_types(col))) or 0 +@objectify_selector +def logged_user_in_rset(cls, req, rset=None, row=None, col=0, **kwargs): + """Return positive score if the result set at the specified row / col + contains the eid of the logged user. + """ + if rset is None: + return 0 + return req.user.eid == rset[row or 0][col] + + # entity selectors ############################################################# class non_final_entity(EClassSelector):