u
This commit is contained in:
@@ -1,4 +1,15 @@
|
||||
import { getStore } from './store.js';
|
||||
import { requireSelectedCompanyAdmin } from './companyuser.js';
|
||||
|
||||
export const ADMIN_ONLY_SETTING_KEYS = new Set([
|
||||
'ui.theme',
|
||||
'keys.tavily',
|
||||
'keys.openrouter',
|
||||
'keys.serper',
|
||||
'modelslugimage',
|
||||
'systemprompt-prefix',
|
||||
'systemprompt-suffix',
|
||||
]);
|
||||
|
||||
export async function list(googleAuthId, options) {
|
||||
const store = await getStore();
|
||||
@@ -11,6 +22,9 @@ export async function getByKey(googleAuthId, key, options) {
|
||||
}
|
||||
|
||||
export async function set(googleAuthId, input) {
|
||||
if (ADMIN_ONLY_SETTING_KEYS.has(input?.key)) {
|
||||
await requireSelectedCompanyAdmin(googleAuthId);
|
||||
}
|
||||
const store = await getStore();
|
||||
return store.companysetting.set(googleAuthId, input);
|
||||
}
|
||||
Reference in New Issue
Block a user