added setPermissions test

This commit is contained in:
jusax23 2023-03-30 17:05:40 +02:00
parent 86748b97e0
commit ee6b9f0050
Signed by: jusax23
GPG key ID: 499E2AA870C1CD41

View file

@ -139,7 +139,7 @@ const list = [
accountKey: accountKey + "lol" accountKey: accountKey + "lol"
}, "error", "auth"); }, "error", "auth");
}], ["admin", async (req) => { }], ["admin", async (req) => {
await req({ let resp = await req({
"authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}` "authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}`
}, "getAccounts", {}, "ok", [ }, "getAccounts", {}, "ok", [
{ {
@ -162,6 +162,35 @@ const list = [
maxUsersPerRoom: 2 maxUsersPerRoom: 2
} }
]); ]);
await req({
"authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}`
}, "setPermissions", {
accID: resp[1].accID,
rights: 5
}, "ok", "");
await req({
"authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}`
}, "getAccounts", {}, "ok", [
{
accID: 1,
rights: 65535,
name: "testUser1",
viewable: true,
deleted: false,
maxRooms: 2,
maxRoomSize: 10,
maxUsersPerRoom: 2
}, {
accID: null,
rights: 5,
name: "testUser2",
viewable: true,
deleted: true,
maxRooms: 2,
maxRoomSize: 10,
maxUsersPerRoom: 2
}
]);
}], ["room Owner", async (req) => { }], ["room Owner", async (req) => {
await req({ await req({
"authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}` "authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}`