Merge pull request #1397 from nextcloud/bugfix/1303/export

Make user id from occ command available in the service
This commit is contained in:
Julius Härtl
2019-12-29 10:08:07 +01:00
committed by GitHub
3 changed files with 11 additions and 23 deletions

View File

@@ -88,13 +88,8 @@ class UserExport extends Command {
$userId = $input->getArgument('user-id');
$groups = $this->groupManager->getUserGroupIds(
$this->userManager->get($userId)
);
$boards = $this->boardService->findAll([
'user' => $userId,
'groups' => $groups
]);
$this->boardService->setUserId($userId);
$boards = $this->boardService->findAll();
$data = [];
foreach ($boards as $board) {

View File

@@ -98,6 +98,15 @@ class BoardService {
$this->userId = $userId;
}
/**
* Set a different user than the current one, e.g. when no user is available in occ
*
* @param string $userId
*/
public function setUserId(string $userId): void {
$this->userId = $userId;
}
/**
* @return array
*/