Add endpoint to get sales_person for current user

This commit is contained in:
Simon Goller 2024-06-12 12:04:41 +02:00
parent 42ebce15e8
commit bd887cfd7b
12 changed files with 108 additions and 5 deletions

View file

@ -36,6 +36,18 @@ where
{
type Context = UserService::Context;
async fn current_user_id(
&self,
context: Authentication<Self::Context>,
) -> Result<Option<Arc<str>>, ServiceError> {
match context {
Authentication::Full => Ok(None),
Authentication::Context(context) => {
let current_user = self.user_service.current_user(context).await?;
Ok(Some(current_user))
}
}
}
async fn check_permission(
&self,
privilege: &str,