3 ms·
I've just been using this to my advantage on a system I'm working on. I've created a bunch of base queries that map from my user account table to each differen
by aidos 11y ago
I've just been using this to my advantage on a system I'm working on.
I've created a bunch of base queries that map from my user account table to each different table that users have access too. I can then use these base queries as a starting point to make sure people don't access records that don't belong to them.
bq = db.query(Obj).join(ParentA).join(ParentB).join(User).filter(User.id==bindparam('user_id'))
q = bq.filter(other_rules).params(user_id=1)...
It's a really flexible system.