move repo_is_allowed check to seperate method