security: Setting global settings requires approval.

This commit is contained in:
Cory McWilliams 2024-11-30 16:58:48 -05:00
parent cd2c2587ae
commit 8e0d91dcf5
2 changed files with 2 additions and 0 deletions

View File

@ -419,6 +419,7 @@ async function getProcessBlob(blobId, key, options) {
return settings?.[key]; return settings?.[key];
}; };
imports.core.globalSettingsSet = async function (key, value) { imports.core.globalSettingsSet = async function (key, value) {
await imports.core.permissionTest('set_global_setting');
print('Setting', key, value); print('Setting', key, value);
let settings = await loadSettings(); let settings = await loadSettings();
settings[key] = value; settings[key] = value;

View File

@ -78,6 +78,7 @@ try:
driver.get('http://localhost:8888/~core/admin/') driver.get('http://localhost:8888/~core/admin/')
select(driver, ['#document', 'frame', '#gs_room_name'], ('send_keys', 'test room')) select(driver, ['#document', 'frame', '#gs_room_name'], ('send_keys', 'test room'))
select(driver, ['#document', 'frame', '//*[@id="gs_room_name"]/following-sibling::button'], ('click',)) select(driver, ['#document', 'frame', '//*[@id="gs_room_name"]/following-sibling::button'], ('click',))
select(driver, ['//button[text()="✅ Allow"]'], ('click',))
driver.switch_to.alert.accept() driver.switch_to.alert.accept()
select(driver, ['tf-navigation', 'shadow_root', '#identity'], ('click',)) select(driver, ['tf-navigation', 'shadow_root', '#identity'], ('click',))