mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
CE-882 Add READ scope; fix filterForLockTree to make correct recursive call
This commit is contained in:
@ -129,8 +129,9 @@ public class RecordSecurityLock implements Cloneable
|
||||
*******************************************************************************/
|
||||
public enum LockScope
|
||||
{
|
||||
READ_AND_WRITE,
|
||||
WRITE
|
||||
READ_AND_WRITE, // lock both reads and writes
|
||||
WRITE, // only lock writes
|
||||
READ // only lock reads
|
||||
}
|
||||
|
||||
|
||||
|
@ -52,7 +52,7 @@ public class RecordSecurityLockFilters
|
||||
*******************************************************************************/
|
||||
public static MultiRecordSecurityLock filterForReadLockTree(List<RecordSecurityLock> recordSecurityLocks)
|
||||
{
|
||||
return filterForLockTree(recordSecurityLocks, Set.of(RecordSecurityLock.LockScope.READ_AND_WRITE));
|
||||
return filterForLockTree(recordSecurityLocks, Set.of(RecordSecurityLock.LockScope.READ_AND_WRITE, RecordSecurityLock.LockScope.READ));
|
||||
}
|
||||
|
||||
|
||||
@ -88,7 +88,7 @@ public class RecordSecurityLockFilters
|
||||
{
|
||||
if(recordSecurityLock instanceof MultiRecordSecurityLock multiRecordSecurityLock)
|
||||
{
|
||||
MultiRecordSecurityLock filteredSubLock = filterForReadLockTree(multiRecordSecurityLock.getLocks());
|
||||
MultiRecordSecurityLock filteredSubLock = filterForLockTree(multiRecordSecurityLock.getLocks(), allowedScopes);
|
||||
filteredSubLock.setOperator(multiRecordSecurityLock.getOperator());
|
||||
result.withLock(filteredSubLock);
|
||||
}
|
||||
|
Reference in New Issue
Block a user