Readonly identity for permission tests.
()
| 63 | |
| 64 | /// Readonly identity for permission tests. |
| 65 | pub fn readonly_user() -> AuthenticatedIdentity { |
| 66 | AuthenticatedIdentity { |
| 67 | user_id: 99, |
| 68 | username: "viewer".into(), |
| 69 | tenant_id: TenantId::new(1), |
| 70 | auth_method: AuthMethod::Trust, |
| 71 | roles: vec![Role::ReadOnly], |
| 72 | is_superuser: false, |
| 73 | default_database: None, |
| 74 | accessible_databases: DatabaseSet::Some(smallvec::smallvec![ |
| 75 | nodedb_types::id::DatabaseId::DEFAULT |
| 76 | ]), |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | /// Run DDL, expect success. |
| 81 | pub async fn ddl_ok(state: &SharedState, identity: &AuthenticatedIdentity, sql: &str) { |
no outgoing calls