fix worker groups for non superadmins
This commit is contained in:
@@ -35,12 +35,7 @@ struct Config {
|
||||
config: serde_json::Value,
|
||||
}
|
||||
|
||||
async fn list_worker_groups(
|
||||
authed: ApiAuthed,
|
||||
Extension(db): Extension<DB>,
|
||||
) -> error::JsonResult<Vec<Config>> {
|
||||
require_super_admin(&db, &authed.email).await?;
|
||||
|
||||
async fn list_worker_groups(Extension(db): Extension<DB>) -> error::JsonResult<Vec<Config>> {
|
||||
let rows = sqlx::query_as!(Config, "SELECT * FROM config WHERE name LIKE 'worker__%'")
|
||||
.fetch_all(&db)
|
||||
.await?;
|
||||
|
||||
@@ -866,7 +866,7 @@ async fn _check_nb_of_workspaces(db: &DB) -> Result<()> {
|
||||
.await?;
|
||||
if nb_workspaces.unwrap_or(0) >= 3 {
|
||||
return Err(Error::BadRequest(
|
||||
"You have reached the maximum number of workspaces (3 outside of default group 'admins') without an enterprise license. Archive/delete another workspace to create a new one"
|
||||
"You have reached the maximum number of workspaces (3 outside of default worskapce 'admins') without an enterprise license. Archive/delete another workspace to create a new one"
|
||||
.to_string(),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -241,5 +241,9 @@
|
||||
delete config
|
||||
</Button>
|
||||
{/if}
|
||||
{:else if config}
|
||||
<span class="text-xs text-secondary"
|
||||
>config <Tooltip>{JSON.stringify(config, null, 4)}</Tooltip></span
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -71,8 +71,10 @@
|
||||
secondInterval = setInterval(() => {
|
||||
timeSinceLastPing += 1
|
||||
}, 1000)
|
||||
loadGlobalCache()
|
||||
loadCustomTags()
|
||||
if ($superadmin) {
|
||||
loadGlobalCache()
|
||||
loadCustomTags()
|
||||
}
|
||||
})
|
||||
|
||||
async function loadGlobalCache() {
|
||||
|
||||
Reference in New Issue
Block a user