More fixes
This commit is contained in:
@@ -12,6 +12,7 @@ use OCP\AppFramework\Db\DoesNotExistException;
|
|||||||
class BoardController extends Controller {
|
class BoardController extends Controller {
|
||||||
private $userId;
|
private $userId;
|
||||||
private $boardService;
|
private $boardService;
|
||||||
|
|
||||||
public function __construct($appName,
|
public function __construct($appName,
|
||||||
IRequest $request,
|
IRequest $request,
|
||||||
BoardService $cardService,
|
BoardService $cardService,
|
||||||
@@ -20,6 +21,7 @@ class BoardController extends Controller {
|
|||||||
$this->userId = $userId;
|
$this->userId = $userId;
|
||||||
$this->boardService = $cardService;
|
$this->boardService = $cardService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @NoAdminRequired
|
* @NoAdminRequired
|
||||||
*/
|
*/
|
||||||
@@ -27,6 +29,7 @@ class BoardController extends Controller {
|
|||||||
|
|
||||||
return $this->boardService->findAll($this->userId);
|
return $this->boardService->findAll($this->userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @NoAdminRequired
|
* @NoAdminRequired
|
||||||
*/
|
*/
|
||||||
@@ -35,18 +38,21 @@ class BoardController extends Controller {
|
|||||||
usleep(200000);
|
usleep(200000);
|
||||||
return $this->boardService->find($this->userId, $boardId);
|
return $this->boardService->find($this->userId, $boardId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @NoAdminRequired
|
* @NoAdminRequired
|
||||||
*/
|
*/
|
||||||
public function create($title, $color) {
|
public function create($title, $color) {
|
||||||
return $this->boardService->create($title, $this->userId, $color);
|
return $this->boardService->create($title, $this->userId, $color);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @NoAdminRequired
|
* @NoAdminRequired
|
||||||
*/
|
*/
|
||||||
public function update($id, $title, $color) {
|
public function update($id, $title, $color) {
|
||||||
return $this->boardService->update($id, $title, $this->userId, $color);
|
return $this->boardService->update($id, $title, $this->userId, $color);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @NoAdminRequired
|
* @NoAdminRequired
|
||||||
*/
|
*/
|
||||||
@@ -57,4 +63,8 @@ class BoardController extends Controller {
|
|||||||
public function labels($boardId) {
|
public function labels($boardId) {
|
||||||
return $this->boardService->labels($this->boardId);
|
return $this->boardService->labels($this->boardId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function addSharee($boardId, $type, $participant, $write, $invite, $manage) {
|
||||||
|
return $this->boardService->addParticipant($boardId, $type, $participant, $write, $invite, $manage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace OCA\Deck\Controller;
|
namespace OCA\Deck\Controller;
|
||||||
|
|
||||||
|
use OCA\Deck\Db\Acl;
|
||||||
use OCP\IGroupManager;
|
use OCP\IGroupManager;
|
||||||
use OCP\IRequest;
|
use OCP\IRequest;
|
||||||
use OCP\AppFramework\ApiController as BaseApiController;
|
use OCP\AppFramework\ApiController as BaseApiController;
|
||||||
@@ -30,15 +31,23 @@ class ShareController extends Controller {
|
|||||||
$limit = null;
|
$limit = null;
|
||||||
$offset = null;
|
$offset = null;
|
||||||
$result = [];
|
$result = [];
|
||||||
$groups = [];
|
foreach ($this->groupManager->search($search, $limit, $offset) as $idx => $group) {
|
||||||
foreach ($this->groupManager->search($search, $limit, $offset) as $group) {
|
$acl = new Acl();
|
||||||
$groups[] = $group->getGID();
|
$acl->setType('group');
|
||||||
$result[] = array('type'=>'group', 'id'=>$group->getGID());
|
$acl->setParticipant($group->getGID());
|
||||||
|
$acl->setPermissionWrite(true);
|
||||||
|
$acl->setPermissionInvite(true);
|
||||||
|
$acl->setPermissionManage(true);
|
||||||
|
$result[] = $acl;
|
||||||
}
|
}
|
||||||
$users = [];
|
foreach ($this->userManager->searchDisplayName($search, $limit, $offset) as $idx => $user) {
|
||||||
foreach ($this->userManager->searchDisplayName($search, $limit, $offset) as $user) {
|
$acl = new Acl();
|
||||||
$users[] = $user->getDisplayName();
|
$acl->setType('user');
|
||||||
$result[] = array('type'=>'group', 'id'=>$user->getUID(), 'displayName'=>$user->getDisplayName());
|
$acl->setParticipant($user->getDisplayName());
|
||||||
|
$acl->setPermissionWrite(true);
|
||||||
|
$acl->setPermissionInvite(true);
|
||||||
|
$acl->setPermissionManage(true);
|
||||||
|
$result[] = $acl;
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user