mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 05:01:07 +00:00
Add todos referencing lock-tree
This commit is contained in:
@ -24,6 +24,7 @@ package com.kingsrook.qqq.backend.core.actions.tables;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -335,6 +336,9 @@ public class UpdateAction
|
|||||||
QTableMetaData table = updateInput.getTable();
|
QTableMetaData table = updateInput.getTable();
|
||||||
QFieldMetaData primaryKeyField = table.getField(table.getPrimaryKeyField());
|
QFieldMetaData primaryKeyField = table.getField(table.getPrimaryKeyField());
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////
|
||||||
|
// todo - evolve to use lock tree (e.g., from multi-locks) //
|
||||||
|
/////////////////////////////////////////////////////////////
|
||||||
List<RecordSecurityLock> onlyWriteLocks = RecordSecurityLockFilters.filterForOnlyWriteLocks(CollectionUtils.nonNullList(table.getRecordSecurityLocks()));
|
List<RecordSecurityLock> onlyWriteLocks = RecordSecurityLockFilters.filterForOnlyWriteLocks(CollectionUtils.nonNullList(table.getRecordSecurityLocks()));
|
||||||
|
|
||||||
for(List<QRecord> page : CollectionUtils.getPages(updateInput.getRecords(), 1000))
|
for(List<QRecord> page : CollectionUtils.getPages(updateInput.getRecords(), 1000))
|
||||||
@ -395,7 +399,7 @@ public class UpdateAction
|
|||||||
QFieldType fieldType = table.getField(lock.getFieldName()).getType();
|
QFieldType fieldType = table.getField(lock.getFieldName()).getType();
|
||||||
Serializable lockValue = ValueUtils.getValueAsFieldType(fieldType, oldRecord.getValue(lock.getFieldName()));
|
Serializable lockValue = ValueUtils.getValueAsFieldType(fieldType, oldRecord.getValue(lock.getFieldName()));
|
||||||
|
|
||||||
List<QErrorMessage> errors = ValidateRecordSecurityLockHelper.validateRecordSecurityValue(table, lock, lockValue, fieldType, ValidateRecordSecurityLockHelper.Action.UPDATE);
|
List<QErrorMessage> errors = ValidateRecordSecurityLockHelper.validateRecordSecurityValue(table, lock, lockValue, fieldType, ValidateRecordSecurityLockHelper.Action.UPDATE, Collections.emptyMap());
|
||||||
if(CollectionUtils.nullSafeHasContents(errors))
|
if(CollectionUtils.nullSafeHasContents(errors))
|
||||||
{
|
{
|
||||||
errors.forEach(e -> record.addError(e));
|
errors.forEach(e -> record.addError(e));
|
||||||
|
@ -405,6 +405,9 @@ public class AbstractMongoDBAction
|
|||||||
QQueryFilter securityFilter = new QQueryFilter();
|
QQueryFilter securityFilter = new QQueryFilter();
|
||||||
securityFilter.setBooleanOperator(QQueryFilter.BooleanOperator.AND);
|
securityFilter.setBooleanOperator(QQueryFilter.BooleanOperator.AND);
|
||||||
|
|
||||||
|
////////////////////////////////////
|
||||||
|
// todo - evolve to use lock tree //
|
||||||
|
////////////////////////////////////
|
||||||
for(RecordSecurityLock recordSecurityLock : RecordSecurityLockFilters.filterForReadLocks(CollectionUtils.nonNullList(table.getRecordSecurityLocks())))
|
for(RecordSecurityLock recordSecurityLock : RecordSecurityLockFilters.filterForReadLocks(CollectionUtils.nonNullList(table.getRecordSecurityLocks())))
|
||||||
{
|
{
|
||||||
addSubFilterForRecordSecurityLock(QContext.getQInstance(), QContext.getQSession(), table, securityFilter, recordSecurityLock, null, table.getName(), false);
|
addSubFilterForRecordSecurityLock(QContext.getQInstance(), QContext.getQSession(), table, securityFilter, recordSecurityLock, null, table.getName(), false);
|
||||||
|
Reference in New Issue
Block a user