Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def is_project_owner(user_id: int, project_id: int):
- # стучим в базу и получаем все записи
- all_rows = AccessibleProjects.query.all()
- # потом нужную нам
- for row in all_rows:
- if row.project_id == project_id and row.user_id == user_id and row.role == 'owner':
- return True
- return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement