diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2020-03-16 22:12:49 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2020-03-25 23:38:26 +0300 |
commit | ba44d7b587af90d7335d341b55c44938e273fb24 (patch) | |
tree | 49fd27747fb0ad86c36d0c826d506b38b99d9d6e /lib | |
parent | 4be03dd91927b6cf330017b61c6bddb09a8796b2 (diff) |
Send parent folder permissions along with workspace file metadata
The folder permissions are sent even if there is no workspace file for
the folder. This will make possible to disable the rich workspaces UI if
creating files is not enabled in a folder.
Rich workspaces are disabled for public share pages, so the folder
permissions are not sent in that case.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Controller/WorkspaceController.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Controller/WorkspaceController.php b/lib/Controller/WorkspaceController.php index fb8b52cef..a1d68f542 100644 --- a/lib/Controller/WorkspaceController.php +++ b/lib/Controller/WorkspaceController.php @@ -116,7 +116,12 @@ class WorkspaceController extends OCSController { if ($folder instanceof Folder) { $file = $this->workspaceService->getFile($folder); if ($file === null) { - return new DataResponse(['message' => 'No workspace file found'], Http::STATUS_NOT_FOUND); + return new DataResponse([ + 'message' => 'No workspace file found', + 'folder' => [ + 'permissions' => $folder->getPermissions() + ] + ], Http::STATUS_NOT_FOUND); } return new DataResponse([ @@ -124,6 +129,9 @@ class WorkspaceController extends OCSController { 'id' => $file->getId(), 'mimetype' => $file->getMimetype(), 'name' => $file->getName() + ], + 'folder' => [ + 'permissions' => $folder->getPermissions() ] ]); } |