]> BookStack Code Mirror - bookstack/blobdiff - app/Services/PermissionService.php
Added transclusion tests and fixed other tests
[bookstack] / app / Services / PermissionService.php
index 6363541ef8ce70180f50fc5028cc04391ac90ef4..65fe0f33e4acf8a854d5002a157ca97afef19b68 100644 (file)
@@ -157,7 +157,7 @@ class PermissionService
      */
     public function buildJointPermissionsForEntity(Entity $entity)
     {
-        $roles = $this->role->with('jointPermissions')->get();
+        $roles = $this->role->get();
         $entities = collect([$entity]);
 
         if ($entity->isA('book')) {
@@ -177,7 +177,7 @@ class PermissionService
      */
     public function buildJointPermissionsForEntities(Collection $entities)
     {
-        $roles = $this->role->with('jointPermissions')->get();
+        $roles = $this->role->get();
         $this->deleteManyJointPermissionsForEntities($entities);
         $this->createManyJointPermissions($entities, $roles);
     }
@@ -564,6 +564,7 @@ class PermissionService
                     });
             });
         });
+        $this->clean();
         return $q;
     }