a session can flush any number of times, so what here determines "after" flush 
state as far as do_orm_execute()? do_orm_execute is not called within the flush 
itself (well, maybe it is...)

If you see do_orm_executes inside of the flush, I guess you could look at 
session._flushing, is that what you are looking for ?

On Wed, Jan 11, 2023, at 7:44 PM, Val Huber wrote:
> In API Logic Server, clients can make RESTful requests that cause SQLAlchemy 
> reads.  These are subjected to authorization security using do_orm_execute 
> (which is amazing, by the way).  These add filters to ensure proper access.  
> This is all fine.
> 
> But, when the client makes changes, these activate business logic, which 
> needs to run *without* auth security.
> 
> My question is: how can my do_orm_execute event handler determine we are 
> in/after after-flush state?  Sorry if I missed them, but I did not find 
> variables method on session or transaction for this.
> 
> Thanks in advance,
> Val
> 
> 
> -- 
> SQLAlchemy - 
> The Python SQL Toolkit and Object Relational Mapper
>  
> http://www.sqlalchemy.org/
>  
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> description.
> --- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/59922a81-8e2c-4575-87c8-e178a99c7a96n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/sqlalchemy/59922a81-8e2c-4575-87c8-e178a99c7a96n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/d864d888-a058-403b-b25b-315cb16d3158%40app.fastmail.com.

Reply via email to