From a95c19e14b5a371240392de480278ee97c01ab12 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 18 May 2022 14:54:27 +0200 Subject: Add share attributes + prevent download permission Makes it possible to store download permission Signed-off-by: Vincent Petry --- lib/private/Share20/Share.php | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'lib/private/Share20/Share.php') diff --git a/lib/private/Share20/Share.php b/lib/private/Share20/Share.php index e21564563a2..1aeb79d4d31 100644 --- a/lib/private/Share20/Share.php +++ b/lib/private/Share20/Share.php @@ -37,6 +37,7 @@ use OCP\Files\Node; use OCP\Files\NotFoundException; use OCP\IUserManager; use OCP\Share\Exceptions\IllegalIDChangeException; +use OCP\Share\IAttributes; use OCP\Share\IShare; class Share implements IShare { @@ -65,6 +66,8 @@ class Share implements IShare { private $shareOwner; /** @var int */ private $permissions; + /** @var IAttributes */ + private $attributes; /** @var int */ private $status; /** @var string */ @@ -332,6 +335,28 @@ class Share implements IShare { return $this->permissions; } + /** + * @inheritdoc + */ + public function newAttributes() { + return new ShareAttributes(); + } + + /** + * @inheritdoc + */ + public function setAttributes(IAttributes $attributes) { + $this->attributes = $attributes; + return $this; + } + + /** + * @inheritdoc + */ + public function getAttributes() { + return $this->attributes; + } + /** * @inheritdoc */ @@ -511,7 +536,7 @@ class Share implements IShare { * Set the parent of this share * * @param int parent - * @return \OCP\Share\IShare + * @return IShare * @deprecated The new shares do not have parents. This is just here for legacy reasons. */ public function setParent($parent) { -- cgit v1.2.3