diff options
author | Joas Schilling <coding@schilljs.com> | 2018-10-17 20:03:44 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2019-03-01 20:56:15 +0100 |
commit | 136d2c39ac72f837a3ea9a3f698be963fefb69a3 (patch) | |
tree | 5b6f44f7a8e49a23533060fd50c0bbeccd292ba2 /lib/public/Collaboration | |
parent | 65a9ab47ea233701b559d08d89e36649a3d5a30b (diff) | |
download | nextcloud-server-136d2c39ac72f837a3ea9a3f698be963fefb69a3.tar.gz nextcloud-server-136d2c39ac72f837a3ea9a3f698be963fefb69a3.zip |
Provider functionality
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/public/Collaboration')
-rw-r--r-- | lib/public/Collaboration/Resources/ICollection.php | 11 | ||||
-rw-r--r-- | lib/public/Collaboration/Resources/IProvider.php | 20 | ||||
-rw-r--r-- | lib/public/Collaboration/Resources/IResource.php | 17 |
3 files changed, 48 insertions, 0 deletions
diff --git a/lib/public/Collaboration/Resources/ICollection.php b/lib/public/Collaboration/Resources/ICollection.php index 408ec67401a..0859ee3397e 100644 --- a/lib/public/Collaboration/Resources/ICollection.php +++ b/lib/public/Collaboration/Resources/ICollection.php @@ -22,6 +22,8 @@ declare(strict_types=1); namespace OCP\Collaboration\Resources; +use OCP\IUser; + /** * @since 15.0.0 */ @@ -49,4 +51,13 @@ interface ICollection { * @since 15.0.0 */ public function removeResource(IResource $resource); + + /** + * Can a user/guest access the collection + * + * @param IUser $user + * @return bool + * @since 15.0.0 + */ + public function canAccess(IUser $user = null): bool; } diff --git a/lib/public/Collaboration/Resources/IProvider.php b/lib/public/Collaboration/Resources/IProvider.php index eac92733dea..bf338113005 100644 --- a/lib/public/Collaboration/Resources/IProvider.php +++ b/lib/public/Collaboration/Resources/IProvider.php @@ -22,7 +22,27 @@ declare(strict_types=1); namespace OCP\Collaboration\Resources; +use OCP\IUser; interface IProvider { + /** + * Get the display name of a resource + * + * @param IResource $resource + * @return string + * @since 15.0.0 + */ + public function getName(IResource $resource): string; + + /** + * Can a user/guest access the collection + * + * @param IResource $resource + * @param IUser $user + * @return bool + * @since 15.0.0 + */ + public function canAccess(IResource $resource, IUser $user = null): bool; + } diff --git a/lib/public/Collaboration/Resources/IResource.php b/lib/public/Collaboration/Resources/IResource.php index 9f8628c0d48..242ad9432d0 100644 --- a/lib/public/Collaboration/Resources/IResource.php +++ b/lib/public/Collaboration/Resources/IResource.php @@ -22,6 +22,8 @@ declare(strict_types=1); namespace OCP\Collaboration\Resources; +use OCP\IUser; + /** * @since 15.0.0 */ @@ -40,6 +42,21 @@ interface IResource { public function getId(): string; /** + * @return string + * @since 15.0.0 + */ + public function getName(): string; + + /** + * Can a user/guest access the resource + * + * @param IUser $user + * @return bool + * @since 15.0.0 + */ + public function canAccess(IUser $user = null): bool; + + /** * @return ICollection[] * @since 15.0.0 */ |