about summary refs log tree commit diff
path: root/kittybox-rs/indieauth
diff options
context:
space:
mode:
Diffstat (limited to 'kittybox-rs/indieauth')
-rw-r--r--kittybox-rs/indieauth/src/lib.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/kittybox-rs/indieauth/src/lib.rs b/kittybox-rs/indieauth/src/lib.rs
index 22dcdbd..a60cc42 100644
--- a/kittybox-rs/indieauth/src/lib.rs
+++ b/kittybox-rs/indieauth/src/lib.rs
@@ -538,6 +538,11 @@ impl TokenData {
             std::time::UNIX_EPOCH + std::time::Duration::from_secs(time)
         })
     }
+
+    /// Check if a certain scope is allowed for this token.
+    pub fn check_scope(&self, scope: &Scope) -> bool {
+        self.scope.has(scope)
+    }
 }
 
 // I don't like this type, because it could've been represented