diff --git a/SeedDMS_Lucene/Lucene/IndexedDocument.php b/SeedDMS_Lucene/Lucene/IndexedDocument.php
index df93e4a35..f3938df8c 100644
--- a/SeedDMS_Lucene/Lucene/IndexedDocument.php
+++ b/SeedDMS_Lucene/Lucene/IndexedDocument.php
@@ -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();
diff --git a/SeedDMS_Lucene/Lucene/Search.php b/SeedDMS_Lucene/Lucene/Search.php
index 857d23ceb..604c1549c 100644
--- a/SeedDMS_Lucene/Lucene/Search.php
+++ b/SeedDMS_Lucene/Lucene/Search.php
@@ -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 {
diff --git a/SeedDMS_Lucene/package.xml b/SeedDMS_Lucene/package.xml
index 4f55862ad..2780d31cd 100644
--- a/SeedDMS_Lucene/package.xml
+++ b/SeedDMS_Lucene/package.xml
@@ -11,11 +11,11 @@
uwe@steinmann.cx
yes
- 2018-04-11
-
+ 2020-09-02
+
- 1.1.13
- 1.1.13
+ 1.1.14
+ 1.1.14
stable
@@ -23,7 +23,7 @@
GPL License
-IndexedDocument() remembers cmd and mimetype
+Index users with at least read access on the document
@@ -299,5 +299,21 @@ allow conversion commands for mimetypes with wildcards
execWithTimeout() reads data from stderr and saves it into error msg
+
+ 2018-04-11
+
+
+ 1.1.13
+ 1.1.13
+
+
+ stable
+ stable
+
+ GPL License
+
+IndexedDocument() remembers cmd and mimetype
+
+