diff --git a/engine/src/api/routes.rs b/engine/src/api/routes.rs index 6dc31898..0f70b115 100644 --- a/engine/src/api/routes.rs +++ b/engine/src/api/routes.rs @@ -467,8 +467,7 @@ async fn get_all_channels( /// ``` #[patch("/channel/{id}")] #[protect( - "Role::GlobalAdmin", - "Role::ChannelAdmin", + any("Role::GlobalAdmin", "Role::ChannelAdmin"), ty = "Role", expr = "user.channels.contains(&*id) || role.has_authority(&Role::GlobalAdmin)" )] diff --git a/frontend/components/ConfigChannel.vue b/frontend/components/ConfigChannel.vue index ef806ae1..c8f9a93f 100644 --- a/frontend/components/ConfigChannel.vue +++ b/frontend/components/ConfigChannel.vue @@ -15,8 +15,9 @@ v-model="channel.name" type="text" placeholder="Type here" - class="input input-bordered w-full" + class="input input-bordered w-full !bg-base-100" @keyup="isChanged" + :disabled="authStore.role === 'User'" /> @@ -27,8 +28,9 @@ @@ -39,8 +41,10 @@ @@ -88,7 +92,7 @@ -
+
diff --git a/frontend/components/ConfigUser.vue b/frontend/components/ConfigUser.vue index dbbce716..8d902830 100644 --- a/frontend/components/ConfigUser.vue +++ b/frontend/components/ConfigUser.vue @@ -149,7 +149,9 @@ const user = ref({ } as User) onMounted(() => { - getUsers() + if (authStore.role === 'GlobalAdmin') { + getUsers() + } }) async function getUsers() { diff --git a/frontend/pages/configure.vue b/frontend/pages/configure.vue index 5c8f0c6c..09ede593 100644 --- a/frontend/pages/configure.vue +++ b/frontend/pages/configure.vue @@ -17,6 +17,7 @@ Advanced