Skip to content

Commit

Permalink
Documented access context trait
Browse files Browse the repository at this point in the history
  • Loading branch information
Uewotm90 committed Dec 11, 2023
1 parent 4b6704a commit 89e1ac9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/contexts/context_traits/access_context_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ use sea_orm::DbErr;

Check warning on line 6 in src/contexts/context_traits/access_context_trait.rs

View workflow job for this annotation

GitHub Actions / cargo fmt

Diff in /home/runner/work/Ecdar-API/Ecdar-API/src/contexts/context_traits/access_context_trait.rs
#[async_trait]
pub trait AccessContextTrait: EntityContextTrait<access::Model> {
/// Searches for an access entity by `User` and `Project` id,
/// returning [`Some`] if any entity was found, [`None`] otherwise
/// # Errors
/// Errors on failed connection, execution error or constraint violations.
async fn get_access_by_uid_and_project_id(
&self,
uid: i32,
project_id: i32,
) -> Result<Option<access::Model>, DbErr>;

/// Returns all [`access::Model`] that are associated with a given `Project``
async fn get_access_by_project_id(&self, project_id: i32) -> Result<Vec<AccessInfo>, DbErr>;
}

0 comments on commit 89e1ac9

Please sign in to comment.