mirror of
https://github.com/Blah-IM/blahrs.git
synced 2025-07-07 06:35:34 +00:00
remove(webapi)!: remove auto user creation on joining or creating room
User must be explicitly created forehand using the registration API (coming soon).
This commit is contained in:
parent
985ea1d68a
commit
7f74d73c8c
3 changed files with 66 additions and 52 deletions
|
@ -202,11 +202,22 @@ fn server() -> Server {
|
|||
|
||||
let mut conn = Connection::open_in_memory().unwrap();
|
||||
Database::maybe_init(&mut conn).unwrap();
|
||||
conn.execute(
|
||||
"INSERT INTO `user` (`userkey`, `permission`) VALUES (?, ?)",
|
||||
params![*ALICE, ServerPermission::ALL],
|
||||
)
|
||||
.unwrap();
|
||||
{
|
||||
let mut add_user = conn
|
||||
.prepare(
|
||||
r"
|
||||
INSERT INTO `user` (`userkey`, `permission`)
|
||||
VALUES (?, ?)
|
||||
",
|
||||
)
|
||||
.unwrap();
|
||||
for (user, perm) in [
|
||||
(&*ALICE, ServerPermission::ALL),
|
||||
(&BOB, ServerPermission::empty()),
|
||||
] {
|
||||
add_user.execute(params![user, perm]).unwrap();
|
||||
}
|
||||
}
|
||||
let db = Database::from_raw(conn).unwrap();
|
||||
|
||||
// Use std's to avoid async, since we need no name resolution.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue