Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Read-only folders won't be deletable
  • Loading branch information
jvillafanez authored and Vincent Petry committed Aug 11, 2016
commit 10d805c810df2eaeaeab2730bcf16fdf4b247d89
11 changes: 11 additions & 0 deletions apps/files_external/lib/Lib/Storage/SMB.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,17 @@ public function isUpdatable($path) {
}
}

public function isDeletable($path) {
try {
$info = $this->getFileInfo($path);
return !$info->isHidden() && !$info->isReadOnly();
} catch (NotFoundException $e) {
return false;
} catch (ForbiddenException $e) {
return false;
}
}

/**
* check if smbclient is installed
*/
Expand Down