a06673b
use uuid::Uuid;
use crate::error::RepoResult;
use crate::features::RepoService;
use super::types::{
AddCollaboratorOption, CollaboratorPage, CollaboratorView, RepoCollaboratorPermission,
};
use super::usecase;
impl RepoService {
pub async fn list_collaborators(
&self,
actor: Uuid,
repo_id: Uuid,
page: Option<u64>,
limit: Option<u64>,
) -> RepoResult<CollaboratorPage> {
usecase::list_collaborators(self, actor, repo_id, page, limit).await
}
pub async fn is_collaborator(
&self,
actor: Uuid,
repo_id: Uuid,
user_id: Uuid,
) -> RepoResult<bool> {
usecase::is_collaborator(self, actor, repo_id, user_id).await
}
pub async fn add_collaborator(
&self,
actor: Uuid,
repo_id: Uuid,
user_id: Uuid,
input: AddCollaboratorOption,
) -> RepoResult<()> {
usecase::add_collaborator(self, actor, repo_id, user_id, input).await
}
pub async fn delete_collaborator(
&self,
actor: Uuid,
repo_id: Uuid,
user_id: Uuid,
) -> RepoResult<()> {
usecase::delete_collaborator(self, actor, repo_id, user_id).await
}
pub async fn get_repo_permissions(
&self,
actor: Uuid,
repo_id: Uuid,
user_id: Uuid,
) -> RepoResult<RepoCollaboratorPermission> {
usecase::get_repo_permissions(self, actor, repo_id, user_id).await
}
}