Extend IShare to show hide download state
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
81f37401f9
commit
bc960bae02
|
@ -30,6 +30,7 @@ use OCP\Files\Node;
|
|||
use OCP\Files\NotFoundException;
|
||||
use OCP\IUserManager;
|
||||
use OCP\Share\Exceptions\IllegalIDChangeException;
|
||||
use OCP\Share\IShare;
|
||||
|
||||
class Share implements \OCP\Share\IShare {
|
||||
|
||||
|
@ -85,6 +86,9 @@ class Share implements \OCP\Share\IShare {
|
|||
/** @var ICacheEntry|null */
|
||||
private $nodeCacheEntry;
|
||||
|
||||
/** @var bool */
|
||||
private $hideDownload = false;
|
||||
|
||||
public function __construct(IRootFolder $rootFolder, IUserManager $userManager) {
|
||||
$this->rootFolder = $rootFolder;
|
||||
$this->userManager = $userManager;
|
||||
|
@ -514,4 +518,13 @@ class Share implements \OCP\Share\IShare {
|
|||
public function getNodeCacheEntry() {
|
||||
return $this->nodeCacheEntry;
|
||||
}
|
||||
|
||||
public function setHideDownload(bool $hide): IShare {
|
||||
$this->hideDownload = $hide;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getHideDownload(): bool {
|
||||
return $this->hideDownload;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -418,4 +418,25 @@ interface IShare {
|
|||
* @since 11.0.0
|
||||
*/
|
||||
public function getNodeCacheEntry();
|
||||
|
||||
/**
|
||||
* Sets a shares hide download state
|
||||
* This is mainly for public shares. It will signal that the share page should
|
||||
* hide download buttons etc.
|
||||
*
|
||||
* @param bool $ro
|
||||
* @return IShare
|
||||
* @since 15.0.0
|
||||
*/
|
||||
public function setHideDownload(bool $hide): IShare;
|
||||
|
||||
/**
|
||||
* Gets a shares hide download state
|
||||
* This is mainly for public shares. It will signal that the share page should
|
||||
* hide download buttons etc.
|
||||
*
|
||||
* @return bool
|
||||
* @since 15.0.0
|
||||
*/
|
||||
public function getHideDownload(): bool;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue