feat: add api endpoint and UI to transfer a board to a different user

Signed-off-by: Luka Trovic <luka@nextcloud.com>
This commit is contained in:
Luka Trovic
2022-03-14 22:42:34 +01:00
committed by Julius Härtl
parent b75fb76c08
commit f46c31f120
5 changed files with 63 additions and 2 deletions

View File

@@ -155,4 +155,15 @@ class BoardController extends ApiController {
public function clone($boardId) {
return $this->boardService->clone($boardId, $this->userId);
}
/**
* @NoAdminRequired
* @param $boardId
* @param $owner
* @param $newOwner
* * @return null|void
*/
public function transferOwner($boardId, $owner, $newOwner) {
return $this->boardService->transferOwnership($owner, $newOwner);
}
}

View File

@@ -746,6 +746,12 @@ class BoardService {
$this->boardsCache = null;
}
private function getBoardOwner($boardId) {
$board = $this->boardMapper->find($boardId);
return $board->getOwner();
}
/**
* Clean a given board data from the Cache
*/