Refuse unless the grant carries `capability`.
(&self, capability: &str)
| 494 | |
| 495 | /// Refuse unless the grant carries `capability`. |
| 496 | pub fn require(&self, capability: &str) -> Result<(), Status> { |
| 497 | if self.grant.allows(capability) { |
| 498 | return Ok(()); |
| 499 | } |
| 500 | Err(domain_status( |
| 501 | ErrorCode::Forbidden, |
| 502 | format!("this sandbox's grant does not include {capability}"), |
| 503 | )) |
| 504 | } |
| 505 | |
| 506 | /// Refuse unless the request is for the grant's repository (and names no |
| 507 | /// host workspace) and `named` — the view the request names, if any — is |
no test coverage detected