ShareByMailProvider: getAccessList: add token to returned array

This allows the share URI to be regenerated.

Signed-off-by: Adam Serbinski <adam@serbinski.com>
pull/32631/head
Adam Serbinski 2 years ago committed by Adam Serbinski
parent 26ae5e6dfb
commit 9c528d412c

@ -1098,7 +1098,7 @@ class ShareByMailProvider implements IShareProvider {
}
$qb = $this->dbConnection->getQueryBuilder();
$qb->select('share_with', 'file_source')
$qb->select('share_with', 'file_source', 'token')
->from('share')
->where($qb->expr()->eq('share_type', $qb->createNamedParameter(IShare::TYPE_EMAIL)))
->andWhere($qb->expr()->in('file_source', $qb->createNamedParameter($ids, IQueryBuilder::PARAM_INT_ARRAY)))
@ -1114,7 +1114,8 @@ class ShareByMailProvider implements IShareProvider {
$mail[] = $row['share_with'];
} else {
$mail[$row['share_with']] = [
'node_id' => $row['file_source']
'node_id' => $row['file_source'],
'token' => $row['token']
];
}
}

@ -1690,8 +1690,8 @@ class Manager implements IManager {
* ],
* public => bool
* mail => [
* 'email1@maildomain1' => ['node_id' => 42],
* 'email2@maildomain2' => ['node_id' => 23],
* 'email1@maildomain1' => ['node_id' => 42, 'token' => 'aBcDeFg'],
* 'email2@maildomain2' => ['node_id' => 23, 'token' => 'hIjKlMn'],
* ]
* ]
*

@ -256,7 +256,7 @@ interface IManager {
* |-folder2 (32)
* |-fileA (42)
*
* fileA is shared with user1 and user1@server1 email1@maildomain1
* fileA is shared with user1 and user1@server1 and email1@maildomain1
* folder2 is shared with group2 (user4 is a member of group2)
* folder1 is shared with user2 (renamed to "folder (1)") and user2@server2
* and email2@maildomain2
@ -274,9 +274,9 @@ interface IManager {
* ],
* public => bool
* mail => [
* 'email1@maildomain1' => ['node_id' => 42],
* 'email2@maildomain2' => ['node_id' => 23],
* ]
* 'email1@maildomain1' => ['node_id' => 42, 'token' => 'aBcDeFg'],
* 'email2@maildomain2' => ['node_id' => 23, 'token' => 'hIjKlMn'],
* ]
*
* The access list to '/folder1/folder2/fileA' **without** $currentAccess is:
* [

Loading…
Cancel
Save