Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. def is_project_owner(user_id: int, project_id: int):
  2.     # стучим в базу и получаем все записи
  3.     all_rows = AccessibleProjects.query.all()
  4.     # потом нужную нам
  5.     for row in all_rows:
  6.         if row.project_id == project_id and row.user_id == user_id and row.role == 'owner':
  7.             return True
  8.     return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement