Add SharingMiddleware for permission checks and small fixes

This commit is contained in:
Julius Haertl
2016-08-24 01:22:45 +02:00
parent 33e99b9e7c
commit 2deffacd98
21 changed files with 452 additions and 115 deletions

View File

@@ -28,7 +28,7 @@ use OCP\AppFramework\Db\Mapper;
use Symfony\Component\Config\Definition\Exception\Exception;
class BoardMapper extends Mapper {
class BoardMapper extends Mapper implements IPermissionMapper {
private $labelMapper;
private $_relationMappers = array();
@@ -136,4 +136,14 @@ class BoardMapper extends Mapper {
}
public function isOwner($userId, $boardId) {
$board = $this->find($boardId);
return ($board->getOwner() === $userId);
}
public function findBoardId($id) {
return $id;
}
}