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