[Pkg-owncloud-commits] [owncloud] 40/121: remove share permissions if user is excluded from sharing

David Prévot taffit at moszumanska.debian.org
Thu Aug 21 16:44:30 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 8c892638f5193a9fe75e7928dbc80c8d50dee570
Author: Bjoern Schiessle <schiessle at owncloud.com>
Date:   Fri Aug 8 12:16:54 2014 +0200

    remove share permissions if user is excluded from sharing
---
 lib/private/files/view.php | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index e08cb20..11c25f8 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -957,6 +957,10 @@ class View {
 					$content['permissions'] = $storage->getPermissions($content['path']);
 					$cache->update($content['fileid'], array('permissions' => $content['permissions']));
 				}
+				// if sharing was disabled for the user we remove the share permissions
+				if (\OCP\Util::isSharingDisabledForUser()) {
+					$content['permissions'] = $content['permissions'] & ~\OCP\PERMISSION_SHARE;
+				}
 				$files[] = new FileInfo($path . '/' . $content['name'], $storage, $content['path'], $content);
 			}
 
@@ -1005,6 +1009,12 @@ class View {
 								}
 							}
 							$rootEntry['path'] = substr($path . '/' . $rootEntry['name'], strlen($user) + 2); // full path without /$user/
+
+							// if sharing was disabled for the user we remove the share permissions
+							if (\OCP\Util::isSharingDisabledForUser()) {
+								$content['permissions'] = $content['permissions'] & ~\OCP\PERMISSION_SHARE;
+							}
+
 							$files[] = new FileInfo($path . '/' . $rootEntry['name'], $subStorage, '', $rootEntry);
 						}
 					}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list