Stichwort SQLAlchemy: Wenn man das über `Table`-Objekte macht, also einfach nur um SQL per Hand schreiben zu vermeiden, könnte das so aussehen (ungetestet):
query = session.query(Ticket)
if not user.admin:
query = query.filter_by(author=user)
return query.all()
Please call it what it is: copyright infringement, not piracy. Piracy takes place in international waters, and involves one or more of theft, murder, rape and kidnapping. Making an unauthorized copy of a piece of software is not piracy, it is an infringement of a government-granted monopoly.