Open source Nest implementation
use crate::models::{pijul::repositories::Repository, users::User};

pub async fn can_apply_patch(
    db: &rocket::State<crate::database::Database>,
    user: &User,
    repo: &Repository<'_>,
) -> bool {
    let owner = repo.owner(db).await;
    
    owner.is_ok() && owner.unwrap()  == *user
}