Always allow getting Sign/User
This commit is contained in:
parent
43a9abdabd
commit
7bfeb4df59
1 changed files with 3 additions and 15 deletions
|
@ -164,29 +164,17 @@ impl<'a> Open<'a> {
|
||||||
|
|
||||||
/// Get a view of the card authenticated for "User" commands.
|
/// Get a view of the card authenticated for "User" commands.
|
||||||
pub fn user_card<'b>(&'b mut self) -> Option<User<'a, 'b>> {
|
pub fn user_card<'b>(&'b mut self) -> Option<User<'a, 'b>> {
|
||||||
if self.pw1 {
|
|
||||||
Some(User { oc: self })
|
Some(User { oc: self })
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get a view of the card authenticated for Signing.
|
/// Get a view of the card authenticated for Signing.
|
||||||
pub fn signing_card<'b>(&'b mut self) -> Option<Sign<'a, 'b>> {
|
pub fn signing_card<'b>(&'b mut self) -> Option<Sign<'a, 'b>> {
|
||||||
if self.pw1_sign {
|
|
||||||
Some(Sign { oc: self })
|
Some(Sign { oc: self })
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get a view of the card authenticated for "Admin" commands.
|
/// Get a view of the card authenticated for "Admin" commands.
|
||||||
pub fn admin_card<'b>(&'b mut self) -> Option<Admin<'a, 'b>> {
|
pub fn admin_card<'b>(&'b mut self) -> Option<Admin<'a, 'b>> {
|
||||||
if self.pw3 {
|
|
||||||
Some(Admin { oc: self })
|
Some(Admin { oc: self })
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- application data ---
|
// --- application data ---
|
||||||
|
|
Loading…
Reference in a new issue