Don't ignore non-updatable files

Don't discriminate with these files; let them have the right to
join the session or generate access token like other sessions
pull/1/head
Pranav Kant 8 years ago
parent 81e60581e4
commit 20d2ce582a

@ -99,16 +99,9 @@ class SessionController extends Controller{
$view = \OC\Files\Filesystem::getView();
$path = $view->getPath($fileId);
if ($view->isUpdatable($path)) {
$file = new File($fileId);
$response = Db\Session::start($this->uid, $file);
} else {
$info = $view->getFileInfo($path);
$response = [
'permissions' => $info['permissions'],
'id' => $fileId
];
}
$file = new File($fileId);
$response = Db\Session::start($this->uid, $file);
$response = array_merge(
$response,
[ 'status'=>'success' ]

@ -18,6 +18,7 @@ $.widget('oc.documentGrid', {
.then(function(){
that._render();
// TODO: Handle all of this logic by sending UserCanWrite: false to loolwsd
if (!documentsMain.isGuest) {
var editGroups = $('#edit_groups').val()
.split('|')
@ -658,6 +659,7 @@ var documentsMain = {
documentsMain.esId = response.es_id;
documentsMain.memberId = response.member_id;
documentsMain.canEdit = response.permissions & OC.PERMISSION_UPDATE;
documentsMain.loadDocument();

@ -49,7 +49,7 @@ class Wopi extends \OCA\Richdocuments\Db{
// Get the virtual path (if the file is shared).
$path = $view->getPath($fileId);
if (!$view->is_file($path) || !$view->isUpdatable($path)) {
if (!$view->is_file($path)) {
throw new \Exception('Invalid fileId.');
}

Loading…
Cancel
Save