This commit is contained in:
parent
940e40fea4
commit
86c97cb977
1 changed files with 9 additions and 0 deletions
|
@ -220,6 +220,15 @@ impl<'r> FromRequest<'r> for MaybeUser {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<MaybeUser> for Option<User> {
|
||||||
|
fn from(value: MaybeUser) -> Self {
|
||||||
|
match value {
|
||||||
|
MaybeUser::User(user) => Some(user),
|
||||||
|
MaybeUser::Anonymous => None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Admin User
|
/// Admin User
|
||||||
///
|
///
|
||||||
/// This struct expects an Admin User and returns `Forbidden` otherwise.
|
/// This struct expects an Admin User and returns `Forbidden` otherwise.
|
||||||
|
|
Loading…
Add table
Reference in a new issue