From df58d5627d377769763963be15944e99828b4f9f Mon Sep 17 00:00:00 2001 From: Julius Haertl Date: Sat, 15 Oct 2016 01:42:24 +0200 Subject: [PATCH] Fix label assignment --- lib/Middleware/SharingMiddleware.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Middleware/SharingMiddleware.php b/lib/Middleware/SharingMiddleware.php index 1e53798b6..3a5cc3141 100644 --- a/lib/Middleware/SharingMiddleware.php +++ b/lib/Middleware/SharingMiddleware.php @@ -133,7 +133,7 @@ class SharingMiddleware extends Middleware { } 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'); $id = $params['stackId']; } else { @@ -192,6 +192,8 @@ class SharingMiddleware extends Middleware { * @return bool */ 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 if ($mapper->isOwner($userId, $id)) {