setPublicAccess(resourceURL, read, write = false, append = false, doAutoAuth = true)
The pods:setPublicAccess()
action modifies the access modes (read
, write
, append
) of a resource for the public, everyone. pods:connectStorage()
should be called at some point prior to using this action (pods:connectStorage()
does not need to be called again if the pico engine is restarted).
The pods:setPublicAccess()
action has the following parameters:
resourceURL — A required string parameter that informs the library which resource is to have its access modes (
read
,write
,append
) modified. The resource can be a folder or a file. This should be a full, absolute URL with anhttp
scheme (e.g. for a folder:http://examplepodserver:org/podName/myPhotos/folder/
, for a file:http://examplepodserver:org/podName/myPhotos/file.txt
) and a folder does require a slash at the end. If a folder’s access modes are modified, only the folder’s access modes are modified but not the content in the folder.read — A required boolean parameter that controls the
read
permission of the specified resource. When true, the public will have the ability to view the resource.write — An optional boolean parameter that controls the
write
permission of the specified resource. When true, the public will have the ability to add new data to the resource, and to change or remove existing data.append — An optional boolean parameter that controls the
append
permission of the specified resource. When true, the public will have the ability to add new data to the resource.doAutoAuth — An optional boolean parameter that controls automatic authentication attempts. It defaults to true if nothing is passed in for it. When true, the library will check that the stored authentication token is valid if it exists, and if the token is not valid or the token does not exist, the library will attempt to automatically authenticate once.
Copyright Picolabs | Licensed under Creative Commons.