diff options
author | Colin Reeder <vpzomtrrfrt@gmail.com> | 2020-10-23 20:40:53 -0600 |
---|---|---|
committer | Colin Reeder <vpzomtrrfrt@gmail.com> | 2020-10-23 20:40:53 -0600 |
commit | 8c98e0d745412d488f9ae7d060c7248b55edf29c (patch) | |
tree | c9cb69f452f4ae1cf75e2216807b224c9288dd4e /src/main.rs | |
parent | 2d73518bc8b89b1e5f2cd638a9a3e2fd13785f92 (diff) |
Show delete link for local content for site admins
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 034990b..fae1aea 100644 --- a/src/main.rs +++ b/src/main.rs @@ -73,6 +73,15 @@ pub struct PageBaseData { pub login: Option<RespLoginInfo>, } +impl PageBaseData { + pub fn is_site_admin(&self) -> bool { + match &self.login { + None => false, + Some(login) => login.user.is_site_admin, + } + } +} + pub fn simple_response( code: hyper::StatusCode, text: impl Into<hyper::Body>, |