()
| 496 | } |
| 497 | |
| 498 | pub fn guest() -> Self { |
| 499 | use crate::prelude::GUEST_ID; |
| 500 | |
| 501 | let user_id = GUEST_ID.to_string(); |
| 502 | Viewer { |
| 503 | read_repo_ids: RepoIds(vec![RepoId::wiki()]), |
| 504 | session_id: None, |
| 505 | context_repo_id: RepoId::wiki(), |
| 506 | super_user: false, |
| 507 | user_id, |
| 508 | write_repo_ids: RepoIds(vec![]), |
| 509 | } |
| 510 | } |
| 511 | |
| 512 | pub fn can_read(&self, repo_id: RepoId) -> bool { |
| 513 | if self.super_user { |