diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2013-05-29 18:08:18 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2013-05-29 18:08:18 -0400 |
commit | dbbf195727d698a5ba46d7cfee06eb9ea7916d96 (patch) | |
tree | 383d2e96375b9579cb5b51507459485f9d0be87e /lib/files/cache/permissions.php | |
parent | 44d217c42529c3f4a0df0a56255887450d37e00b (diff) | |
download | nextcloud-server-dbbf195727d698a5ba46d7cfee06eb9ea7916d96.tar.gz nextcloud-server-dbbf195727d698a5ba46d7cfee06eb9ea7916d96.zip |
Only retrieve the current user's permissions
Diffstat (limited to 'lib/files/cache/permissions.php')
-rw-r--r-- | lib/files/cache/permissions.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/files/cache/permissions.php b/lib/files/cache/permissions.php index 73473142c74..29c30b0f36c 100644 --- a/lib/files/cache/permissions.php +++ b/lib/files/cache/permissions.php @@ -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']; |