Build the delegation scope.
(mut self)
| 496 | |
| 497 | /// Build the delegation scope. |
| 498 | pub fn build(mut self) -> DelegationScope { |
| 499 | // A scope with no permissions would authorize nothing; read is the |
| 500 | // floor, matching `DelegationScope::default()`. |
| 501 | if self.permissions.is_empty() { |
| 502 | self.permissions.push(DelegationPermission::Read); |
| 503 | } |
| 504 | |
| 505 | DelegationScope { |
| 506 | permissions: self.permissions, |
| 507 | servers: self.servers, |
| 508 | workspaces: self.workspaces, |
| 509 | projects: self.projects, |
| 510 | views: self.views, |
| 511 | max_changes: self.max_changes, |
| 512 | description: self.description, |
| 513 | } |
| 514 | } |
| 515 | } |
| 516 | |
| 517 | /// A delegation authorizing an agent to act on behalf of a user. |