Start implementing board sharing

This commit is contained in:
Julius Haertl
2016-08-16 10:29:37 +02:00
parent 135d9c9cbc
commit 6a040f1470
10 changed files with 140 additions and 25 deletions

View File

@@ -14,8 +14,8 @@ class AclMapper extends DeckMapper {
}
public function findAll($boardId, $limit=null, $offset=null) {
$sql = 'SELECT * FROM `*PREFIX*deck_board_acl` WHERE `board_id` = ?';
return $this->findEntities($sql, [$boardId], $limit, $offset);
$sql = 'SELECT id, board_id, type, participant, permission_write, permission_invite, permission_manage, 0 as owner FROM `*PREFIX*deck_board_acl` WHERE `board_id` = ? UNION SELECT 0, id, \'user\', owner, 1, 1, 1, 1 FROM `*PREFIX*deck_boards` WHERE `id` = ? ';
return $this->findEntities($sql, [$boardId, $boardId], $limit, $offset);
}
}