def countResults(self, query=None, sql_catalog_id=None, local_roles=None, **kw): """ Calls ZCatalog.countResults with extra arguments that limit the results to what the user is allowed to see. """ # XXX This needs to be set again #if not _checkPermission( # Permissions.AccessInactivePortalContent, self): # base = aq_base(self) # now = DateTime() # #kw[ 'effective' ] = { 'query' : now, 'range' : 'max' } # #kw[ 'expires' ] = { 'query' : now, 'range' : 'min' } catalog_id = self.getPreferredSQLCatalogId(sql_catalog_id) query = self.getSecurityQuery( query=query, sql_catalog_id=catalog_id, local_roles=local_roles, ) if query is not None: kw['query'] = query kw.setdefault('limit', self.default_count_limit) # get catalog from preference return ZCatalog.countResults(self, sql_catalog_id=catalog_id, **kw)
def countResults(self, query=None, **kw): """ Calls ZCatalog.countResults with extra arguments that limit the results to what the user is allowed to see. """ # XXX This needs to be set again #if not _checkPermission( # Permissions.AccessInactivePortalContent, self): # base = aq_base(self) # now = DateTime() # #kw[ 'effective' ] = { 'query' : now, 'range' : 'max' } # #kw[ 'expires' ] = { 'query' : now, 'range' : 'min' } catalog_id = self.getPreferredSQLCatalogId(kw.pop("sql_catalog_id", None)) query = self.getSecurityQuery(query=query, sql_catalog_id=catalog_id, **kw) kw.setdefault('limit', self.default_count_limit) # get catalog from preference return ZCatalog.countResults(self, query=query, sql_catalog_id=catalog_id, **kw)
def unrestrictedCountResults(self, REQUEST=None, **kw): """Calls ZSQLCatalog.countResults directly without restrictions. """ return ZCatalog.countResults(self, REQUEST, **kw)
def unrestrictedCountResults(self, REQUEST=None, **kw): """Calls ZSQLCatalog.countResults directly without restrictions. """ return ZCatalog.countResults(self, REQUEST, **kw)