1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-07 23:03:00 +03:00

Added and addressed multi-role/own-role-perm/inheretance scenario

Found during manual testing.
Have checked against relation queries manually too.
This commit is contained in:
Dan Brown
2023-01-26 12:53:25 +00:00
parent 48df8725d8
commit f6a6b11ec5
3 changed files with 47 additions and 1 deletions

View File

@@ -99,7 +99,7 @@ class PermissionApplicator
->selectRaw('max(status) as status')
->whereIn('role_id', $this->getCurrentUserRoleIds())
->groupBy(['entity_type', 'entity_id'])
->havingRaw('(status IN (1, 3) or owner_id = ?)', [$this->currentUser()->id]);
->havingRaw('(status IN (1, 3) or (owner_id = ? and status != 2))', [$this->currentUser()->id]);
});
});
}