MCPcopy Create free account
hub / github.com/actix/examples / success

Function success

auth/casbin/src/main.rs:7–14  ·  view source on GitHub ↗

simple handle

(enforcer: web::Data<Enforcer>)

Source from the content-addressed store, hash-verified

5
6/// simple handle
7async fn success(enforcer: web::Data<Enforcer>) -> HttpResponse {
8 assert_eq!(
9 vec!["data2_admin"],
10 enforcer.get_roles_for_user("alice", None)
11 );
12
13 HttpResponse::Ok().body("Success: alice is data2_admin.")
14}
15
16async fn fail(enforcer: web::Data<Enforcer>) -> HttpResponse {
17 assert_eq!(

Callers 2

createFunction · 0.85
deleteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected