Only retrieve the current user's permissions
This commit is contained in:
parent
44d217c425
commit
dbbf195727
|
@ -89,14 +89,15 @@ class Permissions {
|
|||
* get the permissions for all files in a folder
|
||||
*
|
||||
* @param int $parentId
|
||||
* @param string $user
|
||||
* @return int[]
|
||||
*/
|
||||
public function getDirectoryPermissions($parentId) {
|
||||
public function getDirectoryPermissions($parentId, $user) {
|
||||
$query = \OC_DB::prepare('SELECT `*PREFIX*permissions`.`fileid`, `permissions`
|
||||
FROM `*PREFIX*permissions` INNER JOIN `*PREFIX*filecache` ON `*PREFIX*permissions`.fileid = `*PREFIX*filecache`.fileid
|
||||
WHERE `*PREFIX*filecache`.parent = ?');
|
||||
FROM `*PREFIX*permissions` INNER JOIN `*PREFIX*filecache` ON `*PREFIX*permissions`.`fileid` = `*PREFIX*filecache`.`fileid`
|
||||
WHERE `*PREFIX*filecache`.`parent` = ? AND `*PREFIX*permissions`.`user` = ?');
|
||||
|
||||
$result = $query->execute(array($parentId));
|
||||
$result = $query->execute(array($parentId, $user));
|
||||
$filePermissions = array();
|
||||
while ($row = $result->fetchRow()) {
|
||||
$filePermissions[$row['fileid']] = $row['permissions'];
|
||||
|
|
|
@ -797,7 +797,7 @@ class View {
|
|||
}
|
||||
|
||||
$files = $cache->getFolderContents($internalPath); //TODO: mimetype_filter
|
||||
$permissions = $permissionsCache->getDirectoryPermissions($cache->getId($internalPath));
|
||||
$permissions = $permissionsCache->getDirectoryPermissions($cache->getId($internalPath), $user);
|
||||
|
||||
$ids = array();
|
||||
foreach ($files as $i => $file) {
|
||||
|
|
Loading…
Reference in New Issue