Пример #1
0
def new_evalAdvancedQuery(self,query,sortSpecs=()):
    '''evaluate *query* for 'CatalogTool' and sort results according to *sortSpec*.'''
    query = query._clone()

    # taken from 'CatalogTool.searchResults'
    user = _getAuthenticatedUser(self)
    query &= In('allowedRolesAndUsers',self._listAllowedRolesAndUsers(user))
    if not _checkPermission(AccessInactivePortalContent,self):
        now= self.ZopeTime()
        if 'ValidityRange' in self.Indexes.objectIds():
            query &= Eq('ValidityRange', now)
        else:
            if 'effective' in self.Indexes.objectIds():
                query &= Le('effective',now)
            if 'expires' in self.Indexes.objectIds():            
                query &= Ge('expires',now)
    return _eval(self,query,sortSpecs)
Пример #2
0
 def evalAdvancedQuery(self, query, sortSpecs=()):
     # Re-defining the AdvancedQuery monkey patch method, to remove some useless stuff
     # Do not check the access inactive portal content power
     query = query._clone()
     return _eval(self, query, sortSpecs)
Пример #3
0
 def evalAdvancedQuery(self, query, sortSpecs=()):
     # Re-defining the AdvancedQuery monkey patch method, to remove some useless stuff
     # Do not check the access inactive portal content power
     query = query._clone()
     return _eval(self, query, sortSpecs)