This commit is contained in:
parent
940e40fea4
commit
b8384dc6af
1 changed files with 9 additions and 0 deletions
|
@ -220,6 +220,15 @@ impl<'r> FromRequest<'r> for MaybeUser {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Into<Option<User>> for MaybeUser {
|
||||||
|
fn into(self) -> Option<User> {
|
||||||
|
match self {
|
||||||
|
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
Add a link
Reference in a new issue