From fd1ec6a1eaa6dd47940cd255c221efd4793f6e55 Mon Sep 17 00:00:00 2001 From: streamkit-devin Date: Sat, 19 Sep 2026 12:27:01 +0000 Subject: [PATCH] refactor(server): drop unused permission helpers get_default had no callers and can_accept_oneshot was never consulted; the oneshot limit is enforced by the tower ConcurrencyLimitLayer. Signed-off-by: streamkit-devin --- apps/skit/src/permissions.rs | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/apps/skit/src/permissions.rs b/apps/skit/src/permissions.rs index 40dfef44..8d495ba0 100644 --- a/apps/skit/src/permissions.rs +++ b/apps/skit/src/permissions.rs @@ -436,12 +436,6 @@ impl PermissionsConfig { ) } - /// Get the default role permissions - #[allow(dead_code)] - pub fn get_default(&self) -> Permissions { - self.get_role(&self.default_role) - } - /// Check if we can accept a new session (global limit check) pub const fn can_accept_session(&self, current_count: usize) -> bool { match self.max_concurrent_sessions { @@ -449,15 +443,6 @@ impl PermissionsConfig { Some(max) => current_count < max, } } - - /// Check if we can accept a new oneshot pipeline (global limit check) - #[allow(dead_code)] - pub const fn can_accept_oneshot(&self, current_count: usize) -> bool { - match self.max_concurrent_oneshots { - None => true, - Some(max) => current_count < max, - } - } } #[cfg(test)] @@ -544,15 +529,6 @@ mod tests { assert!(!config.can_accept_session(11)); } - #[test] - fn test_global_oneshot_limits() { - let config = PermissionsConfig { max_concurrent_oneshots: Some(5), ..Default::default() }; - - assert!(config.can_accept_oneshot(0)); - assert!(config.can_accept_oneshot(4)); - assert!(!config.can_accept_oneshot(5)); - } - #[test] fn test_user_role_defaults() { let user = Permissions::user();