Use ShareWith and filter shares on the fly
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
parent
e060cfdfc7
commit
e9d84d87f5
5 changed files with 28 additions and 32 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue