added test to send share invitation to multiple groups at once

This commit is contained in:
prajwol
2024-01-15 12:45:46 +05:45
parent 9224b46c05
commit 3b48dfd8bd
3 changed files with 90 additions and 13 deletions
+11 -8
View File
@@ -1581,8 +1581,8 @@ class GraphHelper {
* @param string $password
* @param string $spaceId
* @param string $itemId
* @param string $shareeId
* @param string $shareType
* @param array $shareeIds
* @param array $shareTypes
* @param string|null $permissionsRole
* @param string|null $permissionsAction
* @param string|null $expireDate
@@ -1598,8 +1598,8 @@ class GraphHelper {
string $password,
string $spaceId,
string $itemId,
string $shareeId,
string $shareType,
array $shareeIds,
array $shareTypes,
?string $permissionsRole,
?string $permissionsAction,
?string $expireDate
@@ -1607,10 +1607,13 @@ class GraphHelper {
$url = self::getBetaFullUrl($baseUrl, "drives/$spaceId/items/$itemId/invite");
$body = [];
$recipients['objectId'] = $shareeId;
$recipients['@libre.graph.recipient.type'] = $shareType;
$body['recipients'] = [$recipients];
foreach ($shareeIds as $index => $shareeId) {
$shareType = $shareTypes[$index];
$body['recipients'][] = [
"@libre.graph.recipient.type" => $shareType,
"objectId" => $shareeId
];
}
if ($permissionsRole !== null) {
$roleId = self::getPermissionsRoleIdByName($permissionsRole);