MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / openshell_all_with_user_role

Function openshell_all_with_user_role

crates/openshell-server/src/auth/authz.rs:483–502  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

481
482 #[test]
483 fn openshell_all_with_user_role() {
484 let id = identity_with_roles_and_scopes(&["openshell-user"], &["openshell:all"]);
485 let policy = scoped_policy();
486 assert!(
487 policy
488 .check(&id, "/openshell.v1.OpenShell/ListSandboxes")
489 .is_ok()
490 );
491 assert!(
492 policy
493 .check(&id, "/openshell.v1.OpenShell/GetProvider")
494 .is_ok()
495 );
496 // admin methods still denied by role check
497 assert!(
498 policy
499 .check(&id, "/openshell.v1.OpenShell/CreateProvider")
500 .is_err()
501 );
502 }
503
504 #[test]
505 fn openshell_all_with_admin_role() {

Callers

nothing calls this directly

Calls 2

scoped_policyFunction · 0.85

Tested by

no test coverage detected