summaryrefslogtreecommitdiffstats
path: root/apps/files/index.php
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-09-05 21:46:59 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2012-09-05 21:47:09 -0400
commita5211e31bc170f44edce3c80df831e7705e93396 (patch)
tree9dccdc748433d82a7af1bfb9064143a8d5a4f4df /apps/files/index.php
parentaf3e7674898251f27cc5ec4fe5337583a1eb2398 (diff)
downloadnextcloud-server-a5211e31bc170f44edce3c80df831e7705e93396.tar.gz
nextcloud-server-a5211e31bc170f44edce3c80df831e7705e93396.zip
Add permissions to new files/folders, bug fix for oc-1649
Diffstat (limited to 'apps/files/index.php')
-rw-r--r--apps/files/index.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/files/index.php b/apps/files/index.php
index 6d53527025a..ba785f7d6bc 100644
--- a/apps/files/index.php
+++ b/apps/files/index.php
@@ -89,11 +89,23 @@ $freeSpace=OC_Filesystem::free_space('/');
$freeSpace=max($freeSpace,0);
$maxUploadFilesize = min($maxUploadFilesize ,$freeSpace);
+$permissions = OCP\Share::PERMISSION_READ;
+if (OC_Filesystem::isUpdatable($dir.'/')) {
+ $permissions |= OCP\Share::PERMISSION_UPDATE;
+}
+if (OC_Filesystem::isDeletable($dir.'/')) {
+ $permissions |= OCP\Share::PERMISSION_DELETE;
+}
+if (OC_Filesystem::isSharable($dir.'/')) {
+ $permissions |= OCP\Share::PERMISSION_SHARE;
+}
+
$tmpl = new OCP\Template( 'files', 'index', 'user' );
$tmpl->assign( 'fileList', $list->fetchPage(), false );
$tmpl->assign( 'breadcrumb', $breadcrumbNav->fetchPage(), false );
$tmpl->assign( 'dir', OC_Filesystem::normalizePath($dir));
$tmpl->assign( 'isCreatable', OC_Filesystem::isCreatable($dir.'/'));
+$tmpl->assign('permissions', $permissions);
$tmpl->assign( 'files', $files );
$tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize);
$tmpl->assign( 'uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));