2018-09-14 10:34:24 +00:00
|
|
|
<?php
|
2018-10-16 15:48:16 +00:00
|
|
|
declare(strict_types=1);
|
2018-09-14 10:34:24 +00:00
|
|
|
/**
|
|
|
|
* @copyright Copyright (c) 2018 Joas Schilling <coding@schilljs.com>
|
|
|
|
*
|
|
|
|
* @license GNU AGPL version 3 or any later version
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace OCP\Collaboration\Resources;
|
|
|
|
|
2018-10-17 18:03:44 +00:00
|
|
|
use OCP\IUser;
|
2018-09-14 10:34:24 +00:00
|
|
|
|
2019-02-07 15:04:15 +00:00
|
|
|
/**
|
|
|
|
* @since 16.0.0
|
|
|
|
*/
|
2018-09-14 10:34:24 +00:00
|
|
|
interface IProvider {
|
|
|
|
|
2019-01-24 10:50:01 +00:00
|
|
|
/**
|
2019-02-22 08:58:15 +00:00
|
|
|
* Get the resource type of the provider
|
2019-01-24 10:50:01 +00:00
|
|
|
*
|
|
|
|
* @return string
|
2019-02-07 15:04:15 +00:00
|
|
|
* @since 16.0.0
|
2019-01-24 10:50:01 +00:00
|
|
|
*/
|
|
|
|
public function getType(): string;
|
|
|
|
|
2018-10-17 18:03:44 +00:00
|
|
|
/**
|
2019-03-14 11:30:34 +00:00
|
|
|
* Get the rich object data of a resource
|
2018-10-17 18:03:44 +00:00
|
|
|
*
|
|
|
|
* @param IResource $resource
|
2019-03-14 11:30:34 +00:00
|
|
|
* @return array
|
2019-02-07 15:04:15 +00:00
|
|
|
* @since 16.0.0
|
2019-01-24 11:03:52 +00:00
|
|
|
*/
|
2019-03-14 11:30:34 +00:00
|
|
|
public function getResourceRichObject(IResource $resource): array;
|
2019-01-24 11:03:52 +00:00
|
|
|
|
2018-10-17 18:03:44 +00:00
|
|
|
/**
|
|
|
|
* Can a user/guest access the collection
|
|
|
|
*
|
|
|
|
* @param IResource $resource
|
2019-02-11 11:57:38 +00:00
|
|
|
* @param IUser|null $user
|
2018-10-17 18:03:44 +00:00
|
|
|
* @return bool
|
2019-02-07 15:04:15 +00:00
|
|
|
* @since 16.0.0
|
2018-10-17 18:03:44 +00:00
|
|
|
*/
|
2019-02-11 11:57:38 +00:00
|
|
|
public function canAccessResource(IResource $resource, ?IUser $user): bool;
|
2018-10-17 18:03:44 +00:00
|
|
|
|
2018-09-14 10:34:24 +00:00
|
|
|
}
|