allow unshare file

This commit is contained in:
Xuan Sang LE 2018-02-19 22:11:04 +01:00
parent 5c6c8a8115
commit 421f7e8b6c
2 changed files with 5 additions and 4 deletions

View File

@ -15,10 +15,11 @@ self.OS.API.handler =
path = "#{_REST}/fs/mkdir"
_API.post path, { path: p }, c, (e, s) ->
_courrier.osfail "Fail to create directory: #{p}", e, s
sharefile: (p, c) ->
sharefile: (p, pub , c) ->
path = "#{_REST}/fs/publish"
_API.post path, { path: p }, c, (e, s) ->
_API.post path, { path: p , publish: pub }, c, (e, s) ->
_courrier.osfail "Fail to publish file: #{p}", e, s
fileinfo: (p, c) ->
path = "#{_REST}/fs/fileinfo"
_API.post path, { path: p }, c, (e, s) ->

View File

@ -147,7 +147,7 @@ class RemoteFileHandler extends self.OS.API.VFS.BaseFileHandler
when "remove"
_API.handler.delete @path, f
when "publish"
_API.handler.sharefile @path, f
_API.handler.sharefile @path, true , f
when "download"
return if @info.type is "dir"
_API.handler.fileblob @path, (d) ->
@ -274,7 +274,7 @@ class SharedFileHandler extends self.OS.API.VFS.BaseFileHandler
_API.handler.write @path, p, f
when "remove"
_API.handler.delete @path, f
_API.handler.sharefile @basename, false, f
when "upload"
return