Created
May 4, 2017 02:02
-
-
Save tractorcow/540a3056cfce5d45f0d5c680372dad0c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/Security/InheritedPermissions.php b/src/Security/InheritedPermissions.php | |
index ae8d203..66a1987 100644 | |
--- a/src/Security/InheritedPermissions.php | |
+++ b/src/Security/InheritedPermissions.php | |
@@ -212,6 +212,10 @@ class InheritedPermissions | |
foreach ([ Versioned::DRAFT, Versioned::LIVE ] as $stage) { | |
$stageRecords = Versioned::get_by_stage($this->getBaseClass(), $stage) | |
->byIDs($ids); | |
+ // Exclude previously calculated records from later stage calculations | |
+ if ($combinedStageResult) { | |
+ $stageRecords = $stageRecords->exclude('ID', array_keys($combinedStageResult)); | |
+ } | |
$stageResult = $this->batchPermissionCheckForStage( | |
$type, | |
$globalPermission, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
3.x has a slightly different code style. You'll need to use direct SQL queries.