Fix label assignment

This commit is contained in:
Julius Haertl
2016-10-15 01:42:24 +02:00
parent e60e1fd733
commit df58d5627d

View File

@@ -133,7 +133,7 @@ class SharingMiddleware extends Middleware {
} }
if ($controller instanceof CardController) { if ($controller instanceof CardController) {
if ($method === "POST" && !preg_match('/Label/', $method)) { if ($method === "POST" && !preg_match('/Label/', $methodName)) {
$mapper = $this->container->query('OCA\Deck\Db\StackMapper'); $mapper = $this->container->query('OCA\Deck\Db\StackMapper');
$id = $params['stackId']; $id = $params['stackId'];
} else { } else {
@@ -192,6 +192,8 @@ class SharingMiddleware extends Middleware {
* @return bool * @return bool
*/ */
public function checkMapperPermission($permission, $userId, $mapper, $id) { public function checkMapperPermission($permission, $userId, $mapper, $id) {
// FIXME: This fails with no permission if $id doesn't exist
// We need some fallback to doesn't exist here
// is owner // is owner
if ($mapper->isOwner($userId, $id)) { if ($mapper->isOwner($userId, $id)) {