mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-10 06:52:55 +00:00
The binary etc were renamed some time ago, but the path in the source tree remained "attachment_service" to avoid disruption to ongoing PRs. There aren't any big PRs out right now, so it's a good time to cut over. - Rename `attachment_service` to `storage_controller` - Move it to the top level for symmetry with `storage_broker` & to avoid mixing the non-prod neon_local stuff (`control_plane/`) with the storage controller which is a production component.
10 lines
272 B
Rust
10 lines
272 B
Rust
use utils::auth::{AuthError, Claims, Scope};
|
|
|
|
pub fn check_permission(claims: &Claims, required_scope: Scope) -> Result<(), AuthError> {
|
|
if claims.scope != required_scope {
|
|
return Err(AuthError("Scope mismatch. Permission denied".into()));
|
|
}
|
|
|
|
Ok(())
|
|
}
|