2015-11-05 10:46:37 -05:00
|
|
|
<?php
|
2024-05-27 11:39:07 -04:00
|
|
|
|
2016-01-12 09:02:16 -05:00
|
|
|
/**
|
2024-05-27 11:39:07 -04:00
|
|
|
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2016-01-12 09:02:16 -05:00
|
|
|
*/
|
2016-01-25 11:50:39 -05:00
|
|
|
namespace OCA\DAV\DAV\Sharing;
|
2020-04-09 05:48:10 -04:00
|
|
|
|
2016-01-25 11:50:39 -05:00
|
|
|
use Sabre\DAV\INode;
|
2015-11-05 10:46:37 -05:00
|
|
|
|
|
|
|
|
/**
|
2016-01-25 11:50:39 -05:00
|
|
|
* This interface represents a dav resource that can be shared with other users.
|
2015-11-05 10:46:37 -05:00
|
|
|
*
|
|
|
|
|
*/
|
2016-01-25 11:50:39 -05:00
|
|
|
interface IShareable extends INode {
|
2015-11-05 10:46:37 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Updates the list of shares.
|
|
|
|
|
*
|
|
|
|
|
* The first array is a list of people that are to be added to the
|
2016-01-25 11:50:39 -05:00
|
|
|
* resource.
|
2015-11-05 10:46:37 -05:00
|
|
|
*
|
|
|
|
|
* Every element in the add array has the following properties:
|
|
|
|
|
* * href - A url. Usually a mailto: address
|
|
|
|
|
* * commonName - Usually a first and last name, or false
|
|
|
|
|
* * readOnly - A boolean value
|
|
|
|
|
*
|
|
|
|
|
* Every element in the remove array is just the address string.
|
|
|
|
|
*
|
2022-06-14 09:26:15 -04:00
|
|
|
* @param list<array{href: string, commonName: string, readOnly: bool}> $add
|
|
|
|
|
* @param list<string> $remove
|
2015-11-05 10:46:37 -05:00
|
|
|
*/
|
2022-06-14 09:26:15 -04:00
|
|
|
public function updateShares(array $add, array $remove): void;
|
2015-11-05 10:46:37 -05:00
|
|
|
|
|
|
|
|
/**
|
2016-01-25 11:50:39 -05:00
|
|
|
* Returns the list of people whom this resource is shared with.
|
2015-11-05 10:46:37 -05:00
|
|
|
*
|
|
|
|
|
* Every element in this array should have the following properties:
|
|
|
|
|
* * href - Often a mailto: address
|
|
|
|
|
* * commonName - Optional, for example a first + last name
|
|
|
|
|
* * status - See the Sabre\CalDAV\SharingPlugin::STATUS_ constants.
|
|
|
|
|
* * readOnly - boolean
|
|
|
|
|
*
|
2022-06-14 09:26:15 -04:00
|
|
|
* @return list<array{href: string, commonName: string, status: int, readOnly: bool, '{http://owncloud.org/ns}principal': string, '{http://owncloud.org/ns}group-share': bool}>
|
2015-11-05 10:46:37 -05:00
|
|
|
*/
|
2022-06-14 09:26:15 -04:00
|
|
|
public function getShares(): array;
|
2015-11-05 10:46:37 -05:00
|
|
|
|
2022-06-14 09:26:15 -04:00
|
|
|
public function getResourceId(): int;
|
2016-01-25 16:49:26 -05:00
|
|
|
|
|
|
|
|
/**
|
2022-06-14 09:26:15 -04:00
|
|
|
* @return ?string
|
2016-01-25 16:49:26 -05:00
|
|
|
*/
|
|
|
|
|
public function getOwner();
|
2019-11-22 14:52:10 -05:00
|
|
|
}
|