mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +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'));
|
$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()) {
|
if($attributes = $document->getAttributes()) {
|
||||||
foreach($attributes as $attribute) {
|
foreach($attributes as $attribute) {
|
||||||
$attrdef = $attribute->getAttributeDefinition();
|
$attrdef = $attribute->getAttributeDefinition();
|
||||||
|
|
|
@ -59,7 +59,7 @@ class SeedDMS_Lucene_Search {
|
||||||
* @param object $index lucene index
|
* @param object $index lucene index
|
||||||
* @return object instance of SeedDMS_Lucene_Search
|
* @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 = '';
|
$querystr = '';
|
||||||
if($fields) {
|
if($fields) {
|
||||||
} else {
|
} else {
|
||||||
|
@ -78,6 +78,13 @@ class SeedDMS_Lucene_Search {
|
||||||
$querystr .= implode('" || category:"', $categories);
|
$querystr .= implode('" || category:"', $categories);
|
||||||
$querystr .= '")';
|
$querystr .= '")';
|
||||||
}
|
}
|
||||||
|
if($users) {
|
||||||
|
if($querystr)
|
||||||
|
$querystr .= ' && ';
|
||||||
|
$querystr .= '(users:"';
|
||||||
|
$querystr .= implode('" || users:"', $users);
|
||||||
|
$querystr .= '")';
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
$query = Zend_Search_Lucene_Search_QueryParser::parse($querystr);
|
$query = Zend_Search_Lucene_Search_QueryParser::parse($querystr);
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -11,11 +11,11 @@
|
||||||
<email>uwe@steinmann.cx</email>
|
<email>uwe@steinmann.cx</email>
|
||||||
<active>yes</active>
|
<active>yes</active>
|
||||||
</lead>
|
</lead>
|
||||||
<date>2018-04-11</date>
|
<date>2020-09-02</date>
|
||||||
<time>10:58:13</time>
|
<time>08:55:43</time>
|
||||||
<version>
|
<version>
|
||||||
<release>1.1.13</release>
|
<release>1.1.14</release>
|
||||||
<api>1.1.13</api>
|
<api>1.1.14</api>
|
||||||
</version>
|
</version>
|
||||||
<stability>
|
<stability>
|
||||||
<release>stable</release>
|
<release>stable</release>
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
</stability>
|
</stability>
|
||||||
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
||||||
<notes>
|
<notes>
|
||||||
IndexedDocument() remembers cmd and mimetype
|
Index users with at least read access on the document
|
||||||
</notes>
|
</notes>
|
||||||
<contents>
|
<contents>
|
||||||
<dir baseinstalldir="SeedDMS" name="/">
|
<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
|
execWithTimeout() reads data from stderr and saves it into error msg
|
||||||
</notes>
|
</notes>
|
||||||
</release>
|
</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>
|
</changelog>
|
||||||
</package>
|
</package>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user