()
| 477 | |
| 478 | impl Viewer { |
| 479 | pub fn service_account() -> Self { |
| 480 | Self { |
| 481 | read_repo_ids: RepoIds(vec![]), |
| 482 | context_repo_id: RepoId::wiki(), |
| 483 | session_id: None, |
| 484 | super_user: true, |
| 485 | user_id: "".to_owned(), |
| 486 | write_repo_ids: RepoIds(vec![]), |
| 487 | } |
| 488 | } |
| 489 | |
| 490 | pub fn ensure_can_read(&self, repo_id: RepoId) -> Result<()> { |
| 491 | if !self.can_read(repo_id) { |