]> BookStack Code Mirror - bookstack/blobdiff - app/Repos/EntityRepo.php
Added initial translation into German (formal)
[bookstack] / app / Repos / EntityRepo.php
index 28f4c0ae8466a805b456cb8ba2eb08e5e7b98038..42b0b6b7bef89aecfbecc0f914fde8266ec7eb5e 100644 (file)
@@ -6,6 +6,7 @@ use BookStack\Entity;
 use BookStack\Page;
 use BookStack\Services\PermissionService;
 use BookStack\User;
+use Illuminate\Support\Collection;
 use Illuminate\Support\Facades\Log;
 
 class EntityRepo
@@ -131,9 +132,8 @@ class EntityRepo
      */
     public function getUserDraftPages($count = 20, $page = 0)
     {
-        $user = auth()->user();
         return $this->page->where('draft', '=', true)
-            ->where('created_by', '=', $user->id)
+            ->where('created_by', '=', user()->id)
             ->orderBy('updated_at', 'desc')
             ->skip($count * $page)->take($count)->get();
     }
@@ -260,6 +260,15 @@ class EntityRepo
         return $query;
     }
 
+    /**
+     * Alias method to update the book jointPermissions in the PermissionService.
+     * @param Collection $collection collection on entities
+     */
+    public function buildJointPermissions(Collection $collection)
+    {
+        $this->permissionService->buildJointPermissionsForEntities($collection);
+    }
+
 }