Add endpoint to get sales_person for current user
This commit is contained in:
parent
42ebce15e8
commit
bd887cfd7b
12 changed files with 108 additions and 5 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue