The view a data op acts on: a sandbox's grant view (an explicit target must be it, and the grant must carry `capability`), or the view a local caller names.
(
caller: Option<&SandboxCaller>,
handle: &RepoHandle,
repository: &RepositoryRef,
target: Option<&ViewRef>,
capability: &str,
)
| 124 | /// must be it, and the grant must carry `capability`), or the view a local |
| 125 | /// caller names. |
| 126 | fn data_view( |
| 127 | caller: Option<&SandboxCaller>, |
| 128 | handle: &RepoHandle, |
| 129 | repository: &RepositoryRef, |
| 130 | target: Option<&ViewRef>, |
| 131 | capability: &str, |
| 132 | ) -> Result<String, Status> { |
| 133 | match caller { |
| 134 | Some(caller) => { |
| 135 | caller.require(capability)?; |
| 136 | caller.require_target(handle, repository, target)?; |
| 137 | Ok(caller.view().to_string()) |
| 138 | } |
| 139 | None => named_view(target, ""), |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | /// The view exists — and, for a grant that recorded the view's id, it is |
| 144 | /// still the view the grant was issued for (deleting a view and recreating |
no test coverage detected