summaryrefslogtreecommitdiffstats
path: root/lib/files/cache/permissions.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/files/cache/permissions.php')
-rw-r--r--lib/files/cache/permissions.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/files/cache/permissions.php b/lib/files/cache/permissions.php
index a5c9c144054..faa5ff5eacc 100644
--- a/lib/files/cache/permissions.php
+++ b/lib/files/cache/permissions.php
@@ -107,4 +107,19 @@ class Permissions {
$query->execute(array($fileId, $user));
}
}
+
+ /**
+ * get the list of users which have permissions stored for a file
+ *
+ * @param int $fileId
+ */
+ public function getUsers($fileId) {
+ $query = \OC_DB::prepare('SELECT `user` FROM `*PREFIX*permissions` WHERE `fileid` = ?');
+ $result = $query->execute(array($fileId));
+ $users = array();
+ while ($row = $result->fetchRow()) {
+ $users[] = $row['user'];
+ }
+ return $users;
+ }
}