mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 07:04:57 +00:00
index users with read access on a document, start version 1.1.14
This commit is contained in:
parent
e21850c92f
commit
a29c0f35aa
|
@ -138,6 +138,18 @@ class SeedDMS_Lucene_IndexedDocument extends Zend_Search_Lucene_Document {
|
|||
}
|
||||
$this->addField(Zend_Search_Lucene_Field::Text('category', implode(' ', $names), 'utf-8'));
|
||||
}
|
||||
if($acllist = $document->getReadAccessList(1, 1, 1)) {
|
||||
$allu = [];
|
||||
foreach($acllist['users'] as $u)
|
||||
$allu[] = $u->getLogin();
|
||||
$this->addField(Zend_Search_Lucene_Field::Text('users', implode(' ', $allu), 'utf-8'));
|
||||
/*
|
||||
$allg = [];
|
||||
foreach($acllist['groups'] as $g)
|
||||
$allg[] = $g->getName();
|
||||
$this->addField(Zend_Search_Lucene_Field::Text('groups', implode(' ', $allg), 'utf-8'));
|
||||
*/
|
||||
}
|
||||
if($attributes = $document->getAttributes()) {
|
||||
foreach($attributes as $attribute) {
|
||||
$attrdef = $attribute->getAttributeDefinition();
|
||||
|
|
|
@ -59,7 +59,7 @@ class SeedDMS_Lucene_Search {
|
|||
* @param object $index lucene index
|
||||
* @return object instance of SeedDMS_Lucene_Search
|
||||
*/
|
||||
function search($term, $owner, $status='', $categories=array(), $fields=array()) { /* {{{ */
|
||||
function search($term, $owner, $status='', $categories=array(), $fields=array(), $users=array()) { /* {{{ */
|
||||
$querystr = '';
|
||||
if($fields) {
|
||||
} else {
|
||||
|
@ -78,6 +78,13 @@ class SeedDMS_Lucene_Search {
|
|||
$querystr .= implode('" || category:"', $categories);
|
||||
$querystr .= '")';
|
||||
}
|
||||
if($users) {
|
||||
if($querystr)
|
||||
$querystr .= ' && ';
|
||||
$querystr .= '(users:"';
|
||||
$querystr .= implode('" || users:"', $users);
|
||||
$querystr .= '")';
|
||||
}
|
||||
try {
|
||||
$query = Zend_Search_Lucene_Search_QueryParser::parse($querystr);
|
||||
try {
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
<email>uwe@steinmann.cx</email>
|
||||
<active>yes</active>
|
||||
</lead>
|
||||
<date>2018-04-11</date>
|
||||
<time>10:58:13</time>
|
||||
<date>2020-09-02</date>
|
||||
<time>08:55:43</time>
|
||||
<version>
|
||||
<release>1.1.13</release>
|
||||
<api>1.1.13</api>
|
||||
<release>1.1.14</release>
|
||||
<api>1.1.14</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
|
@ -23,7 +23,7 @@
|
|||
</stability>
|
||||
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
||||
<notes>
|
||||
IndexedDocument() remembers cmd and mimetype
|
||||
Index users with at least read access on the document
|
||||
</notes>
|
||||
<contents>
|
||||
<dir baseinstalldir="SeedDMS" name="/">
|
||||
|
@ -299,5 +299,21 @@ allow conversion commands for mimetypes with wildcards
|
|||
execWithTimeout() reads data from stderr and saves it into error msg
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<date>2018-04-11</date>
|
||||
<time>10:58:13</time>
|
||||
<version>
|
||||
<release>1.1.13</release>
|
||||
<api>1.1.13</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
||||
<notes>
|
||||
IndexedDocument() remembers cmd and mimetype
|
||||
</notes>
|
||||
</release>
|
||||
</changelog>
|
||||
</package>
|
||||
|
|
Loading…
Reference in New Issue
Block a user