diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-06-28 12:09:58 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-06-28 13:00:58 +0200 |
commit | f22af90c09926192ff17c77755c0359c7e0c072f (patch) | |
tree | 2fe2c8f1e6e2a2487c5e2aee9ad631c58d75a216 /apps/files_versions/lib | |
parent | 894b7d93f6de7229802a5d42c5e56d0f0c6ab587 (diff) | |
download | nextcloud-server-f22af90c09926192ff17c77755c0359c7e0c072f.tar.gz nextcloud-server-f22af90c09926192ff17c77755c0359c7e0c072f.zip |
Hide revert button when no permission to revert
Diffstat (limited to 'apps/files_versions/lib')
-rw-r--r-- | apps/files_versions/lib/Storage.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php index 93f8b848ce8..6345d4c303b 100644 --- a/apps/files_versions/lib/Storage.php +++ b/apps/files_versions/lib/Storage.php @@ -320,8 +320,16 @@ class Storage { // add expected leading slash $file = '/' . ltrim($file, '/'); list($uid, $filename) = self::getUidAndFilename($file); + if ($uid === null || trim($filename, '/') === '') { + return false; + } $users_view = new View('/'.$uid); $files_view = new View('/'. User::getUser().'/files'); + + if (!$files_view->isUpdatable($filename)) { + return false; + } + $versionCreated = false; //first create a new version |