Use ShareWith and filter shares on the fly

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2020-05-06 12:39:52 +02:00
commit e9d84d87f5
No known key found for this signature in database
GPG key ID: 60C25B8C072916CF
5 changed files with 28 additions and 32 deletions

View file

@ -216,10 +216,10 @@ class ApiController extends Controller {
try {
if ($keyValuePairs['access']) {
$keyValuePairs['access']['users'] = array_map(function (array $user): string {
return $user['id'];
return $user['shareWith'];
}, $keyValuePairs['access']['users']);
$keyValuePairs['access']['groups'] = array_map(function (array $group): string {
return $group['id'];
return $group['shareWith'];
}, $keyValuePairs['access']['groups']);
}
} catch (Exception $e) {

View file

@ -234,7 +234,7 @@ class FormsService {
$user = $this->userManager->get($userId);
if ($user instanceof IUser) {
return [
'id' => $userId,
'shareWith' => $userId,
'displayName' => $user->getDisplayName(),
'shareType' => IShare::TYPE_USER
];
@ -252,7 +252,7 @@ class FormsService {
$group = $this->groupManager->get($groupId);
if ($group instanceof IGroup) {
return [
'id' => $groupId,
'shareWith' => $groupId,
'displayName' => $group->getDisplayName(),
'shareType' => IShare::TYPE_GROUP
];