2018-10-30 20:24:15 +03:00
|
|
|
<?php
|
|
|
|
|
2019-12-03 21:57:53 +03:00
|
|
|
declare(strict_types=1);
|
2018-10-30 20:24:15 +03:00
|
|
|
|
|
|
|
/**
|
2019-12-03 21:57:53 +03:00
|
|
|
* @copyright 2018
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
|
|
|
* @author Maxence Lange <maxence@artificial-owl.com>
|
2019-12-03 21:57:53 +03:00
|
|
|
*
|
2018-10-30 20:24:15 +03:00
|
|
|
* @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
|
2019-12-03 21:57:53 +03:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace OCP\FullTextSearch\Model;
|
|
|
|
|
|
|
|
/**
|
2019-02-20 13:38:19 +03:00
|
|
|
* Interface IDocumentAccess
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
|
|
|
* This object is used as a data transfer object when
|
|
|
|
*
|
|
|
|
* - indexing a document,
|
|
|
|
* - generating a search request.
|
|
|
|
*
|
|
|
|
* During the index, it is used to define which users, groups, circles, ...
|
2019-02-20 13:38:19 +03:00
|
|
|
* have access to the IIndexDocument
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
|
|
|
* During the search, it is internally use to define to which group, circles, ...
|
|
|
|
* a user that perform the search belongs to.
|
|
|
|
*
|
2019-02-20 13:38:19 +03:00
|
|
|
* @see IIndexDocument::setAccess
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
2019-03-04 13:49:29 +03:00
|
|
|
* @since 16.0.0
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
|
|
|
* @package OCP\FullTextSearch\Model
|
|
|
|
*/
|
2019-02-20 13:38:19 +03:00
|
|
|
interface IDocumentAccess {
|
2018-10-30 20:24:15 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Owner of the document can be set at the init of the object.
|
|
|
|
*
|
2019-03-04 13:49:29 +03:00
|
|
|
* @since 16.0.0
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
2019-02-20 13:38:19 +03:00
|
|
|
* IDocumentAccess constructor.
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
|
|
|
* @param string $ownerId
|
|
|
|
*/
|
2019-02-20 13:38:19 +03:00
|
|
|
public function __construct(string $ownerId = '');
|
2018-10-30 20:24:15 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the Owner of the document.
|
|
|
|
*
|
2019-03-04 13:49:29 +03:00
|
|
|
* @since 16.0.0
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
|
|
|
* @param string $ownerId
|
|
|
|
*
|
2019-02-20 13:38:19 +03:00
|
|
|
* @return IDocumentAccess
|
2018-10-30 20:24:15 +03:00
|
|
|
*/
|
2019-02-20 13:38:19 +03:00
|
|
|
public function setOwnerId(string $ownerId): IDocumentAccess;
|
2018-10-30 20:24:15 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the Owner of the document.
|
|
|
|
*
|
2019-03-04 13:49:29 +03:00
|
|
|
* @since 16.0.0
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
2019-02-20 13:38:19 +03:00
|
|
|
public function getOwnerId(): string;
|
2018-10-30 20:24:15 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the viewer of the document.
|
|
|
|
*
|
2019-03-04 13:49:29 +03:00
|
|
|
* @since 16.0.0
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
|
|
|
* @param string $viewerId
|
|
|
|
*
|
2019-02-20 13:38:19 +03:00
|
|
|
* @return IDocumentAccess
|
2018-10-30 20:24:15 +03:00
|
|
|
*/
|
2019-02-20 13:38:19 +03:00
|
|
|
public function setViewerId(string $viewerId): IDocumentAccess;
|
2018-10-30 20:24:15 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the viewer of the document.
|
|
|
|
*
|
2019-03-04 13:49:29 +03:00
|
|
|
* @since 16.0.0
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
2019-02-20 13:38:19 +03:00
|
|
|
public function getViewerId(): string;
|
2018-10-30 20:24:15 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the list of users that have read access to the document.
|
|
|
|
*
|
2019-03-04 13:49:29 +03:00
|
|
|
* @since 16.0.0
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
|
|
|
* @param array $users
|
|
|
|
*
|
2019-02-20 13:38:19 +03:00
|
|
|
* @return IDocumentAccess
|
2018-10-30 20:24:15 +03:00
|
|
|
*/
|
2019-02-20 13:38:19 +03:00
|
|
|
public function setUsers(array $users): IDocumentAccess;
|
2018-10-30 20:24:15 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Add an entry to the list of users that have read access to the document.
|
|
|
|
*
|
2019-03-04 13:49:29 +03:00
|
|
|
* @since 16.0.0
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
|
|
|
* @param string $user
|
|
|
|
*
|
2019-02-20 13:38:19 +03:00
|
|
|
* @return IDocumentAccess
|
2018-10-30 20:24:15 +03:00
|
|
|
*/
|
2019-02-20 13:38:19 +03:00
|
|
|
public function addUser(string $user): IDocumentAccess;
|
2018-10-30 20:24:15 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Add multiple entries to the list of users that have read access to the
|
|
|
|
* document.
|
|
|
|
*
|
2019-03-04 13:49:29 +03:00
|
|
|
* @since 16.0.0
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
|
|
|
* @param array $users
|
|
|
|
*
|
2019-02-20 13:38:19 +03:00
|
|
|
* @return IDocumentAccess
|
2018-10-30 20:24:15 +03:00
|
|
|
*/
|
2019-02-20 13:38:19 +03:00
|
|
|
public function addUsers($users): IDocumentAccess;
|
2018-10-30 20:24:15 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the complete list of users that have read access to the document.
|
|
|
|
*
|
2019-03-04 13:49:29 +03:00
|
|
|
* @since 16.0.0
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
2019-02-20 13:38:19 +03:00
|
|
|
public function getUsers(): array;
|
2018-10-30 20:24:15 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the list of groups that have read access to the document.
|
|
|
|
*
|
2019-03-04 13:49:29 +03:00
|
|
|
* @since 16.0.0
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
|
|
|
* @param array $groups
|
|
|
|
*
|
2019-02-20 13:38:19 +03:00
|
|
|
* @return IDocumentAccess
|
2018-10-30 20:24:15 +03:00
|
|
|
*/
|
2019-02-20 13:38:19 +03:00
|
|
|
public function setGroups(array $groups): IDocumentAccess;
|
2018-10-30 20:24:15 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Add an entry to the list of groups that have read access to the document.
|
|
|
|
*
|
2019-03-04 13:49:29 +03:00
|
|
|
* @since 16.0.0
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
|
|
|
* @param string $group
|
|
|
|
*
|
2019-02-20 13:38:19 +03:00
|
|
|
* @return IDocumentAccess
|
2018-10-30 20:24:15 +03:00
|
|
|
*/
|
2019-02-20 13:38:19 +03:00
|
|
|
public function addGroup(string $group): IDocumentAccess;
|
2018-10-30 20:24:15 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Add multiple entries to the list of groups that have read access to the
|
|
|
|
* document.
|
|
|
|
*
|
2019-03-04 13:49:29 +03:00
|
|
|
* @since 16.0.0
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
|
|
|
* @param array $groups
|
|
|
|
*
|
2019-02-20 13:38:19 +03:00
|
|
|
* @return IDocumentAccess
|
2018-10-30 20:24:15 +03:00
|
|
|
*/
|
2019-02-20 13:38:19 +03:00
|
|
|
public function addGroups(array $groups);
|
2018-10-30 20:24:15 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the complete list of groups that have read access to the document.
|
|
|
|
*
|
2019-03-04 13:49:29 +03:00
|
|
|
* @since 16.0.0
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
2019-02-20 13:38:19 +03:00
|
|
|
public function getGroups(): array;
|
2018-10-30 20:24:15 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the list of circles that have read access to the document.
|
|
|
|
*
|
2019-03-04 13:49:29 +03:00
|
|
|
* @since 16.0.0
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
|
|
|
* @param array $circles
|
|
|
|
*
|
2019-02-20 13:38:19 +03:00
|
|
|
* @return IDocumentAccess
|
2018-10-30 20:24:15 +03:00
|
|
|
*/
|
2019-02-20 13:38:19 +03:00
|
|
|
public function setCircles(array $circles): IDocumentAccess;
|
2018-10-30 20:24:15 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Add an entry to the list of circles that have read access to the document.
|
|
|
|
*
|
2019-03-04 13:49:29 +03:00
|
|
|
* @since 16.0.0
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
|
|
|
* @param string $circle
|
|
|
|
*
|
2019-02-20 13:38:19 +03:00
|
|
|
* @return IDocumentAccess
|
2018-10-30 20:24:15 +03:00
|
|
|
*/
|
2019-02-20 13:38:19 +03:00
|
|
|
public function addCircle(string $circle): IDocumentAccess;
|
2018-10-30 20:24:15 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Add multiple entries to the list of groups that have read access to the
|
|
|
|
* document.
|
|
|
|
*
|
2019-03-04 13:49:29 +03:00
|
|
|
* @since 16.0.0
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
|
|
|
* @param array $circles
|
|
|
|
*
|
2019-02-20 13:38:19 +03:00
|
|
|
* @return IDocumentAccess
|
2018-10-30 20:24:15 +03:00
|
|
|
*/
|
2019-02-20 13:38:19 +03:00
|
|
|
public function addCircles(array $circles): IDocumentAccess;
|
2018-10-30 20:24:15 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the complete list of circles that have read access to the document.
|
|
|
|
*
|
2019-03-04 13:49:29 +03:00
|
|
|
* @since 16.0.0
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
2019-02-20 13:38:19 +03:00
|
|
|
public function getCircles(): array;
|
2018-10-30 20:24:15 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the list of links that have read access to the document.
|
|
|
|
*
|
2019-03-04 13:49:29 +03:00
|
|
|
* @since 16.0.0
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
|
|
|
* @param array $links
|
|
|
|
*
|
2019-02-20 13:38:19 +03:00
|
|
|
* @return IDocumentAccess
|
2018-10-30 20:24:15 +03:00
|
|
|
*/
|
2019-02-20 13:38:19 +03:00
|
|
|
public function setLinks(array $links): IDocumentAccess;
|
2018-10-30 20:24:15 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the list of links that have read access to the document.
|
|
|
|
*
|
2019-03-04 13:49:29 +03:00
|
|
|
* @since 16.0.0
|
2018-10-30 20:24:15 +03:00
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
2019-02-20 13:38:19 +03:00
|
|
|
public function getLinks(): array;
|
2018-10-30 20:24:15 +03:00
|
|
|
}
|