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
This commit is contained in:
parent
81e60581e4
commit
20d2ce582a
@ -99,16 +99,9 @@ class SessionController extends Controller{
|
|||||||
$view = \OC\Files\Filesystem::getView();
|
$view = \OC\Files\Filesystem::getView();
|
||||||
$path = $view->getPath($fileId);
|
$path = $view->getPath($fileId);
|
||||||
|
|
||||||
if ($view->isUpdatable($path)) {
|
|
||||||
$file = new File($fileId);
|
$file = new File($fileId);
|
||||||
$response = Db\Session::start($this->uid, $file);
|
$response = Db\Session::start($this->uid, $file);
|
||||||
} else {
|
|
||||||
$info = $view->getFileInfo($path);
|
|
||||||
$response = [
|
|
||||||
'permissions' => $info['permissions'],
|
|
||||||
'id' => $fileId
|
|
||||||
];
|
|
||||||
}
|
|
||||||
$response = array_merge(
|
$response = array_merge(
|
||||||
$response,
|
$response,
|
||||||
[ 'status'=>'success' ]
|
[ 'status'=>'success' ]
|
||||||
|
@ -18,6 +18,7 @@ $.widget('oc.documentGrid', {
|
|||||||
.then(function(){
|
.then(function(){
|
||||||
that._render();
|
that._render();
|
||||||
|
|
||||||
|
// TODO: Handle all of this logic by sending UserCanWrite: false to loolwsd
|
||||||
if (!documentsMain.isGuest) {
|
if (!documentsMain.isGuest) {
|
||||||
var editGroups = $('#edit_groups').val()
|
var editGroups = $('#edit_groups').val()
|
||||||
.split('|')
|
.split('|')
|
||||||
@ -658,6 +659,7 @@ var documentsMain = {
|
|||||||
|
|
||||||
documentsMain.esId = response.es_id;
|
documentsMain.esId = response.es_id;
|
||||||
documentsMain.memberId = response.member_id;
|
documentsMain.memberId = response.member_id;
|
||||||
|
documentsMain.canEdit = response.permissions & OC.PERMISSION_UPDATE;
|
||||||
|
|
||||||
documentsMain.loadDocument();
|
documentsMain.loadDocument();
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ class Wopi extends \OCA\Richdocuments\Db{
|
|||||||
// Get the virtual path (if the file is shared).
|
// Get the virtual path (if the file is shared).
|
||||||
$path = $view->getPath($fileId);
|
$path = $view->getPath($fileId);
|
||||||
|
|
||||||
if (!$view->is_file($path) || !$view->isUpdatable($path)) {
|
if (!$view->is_file($path)) {
|
||||||
throw new \Exception('Invalid fileId.');
|
throw new \Exception('Invalid fileId.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user