fix user permissions
This commit is contained in:
parent
3cf0d12200
commit
532c4b4615
@ -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)"
|
||||
)]
|
||||
|
@ -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'"
|
||||
/>
|
||||
</label>
|
||||
|
||||
@ -27,8 +28,9 @@
|
||||
<input
|
||||
v-model="channel.preview_url"
|
||||
type="text"
|
||||
class="input input-bordered w-full"
|
||||
class="input input-bordered w-full !bg-base-100"
|
||||
@keyup="isChanged"
|
||||
:disabled="authStore.role === 'User'"
|
||||
/>
|
||||
</label>
|
||||
|
||||
@ -39,8 +41,10 @@
|
||||
<input
|
||||
v-model="channel.extra_extensions"
|
||||
type="text"
|
||||
class="input input-bordered w-full"
|
||||
class="input input-bordered w-full !bg-base-100"
|
||||
:class="'input-disabled'"
|
||||
@keyup="isChanged"
|
||||
:disabled="authStore.role === 'User'"
|
||||
/>
|
||||
</label>
|
||||
|
||||
@ -88,7 +92,7 @@
|
||||
</label>
|
||||
</template>
|
||||
|
||||
<div class="my-4 flex gap-1">
|
||||
<div v-if="authStore.role !== 'User'" class="my-4 flex gap-1">
|
||||
<button class="btn" :class="saved ? 'btn-primary' : 'btn-error'" @click="addUpdateChannel()">
|
||||
{{ t('config.save') }}
|
||||
</button>
|
||||
|
@ -149,7 +149,9 @@ const user = ref({
|
||||
} as User)
|
||||
|
||||
onMounted(() => {
|
||||
if (authStore.role === 'GlobalAdmin') {
|
||||
getUsers()
|
||||
}
|
||||
})
|
||||
|
||||
async function getUsers() {
|
||||
|
@ -17,6 +17,7 @@
|
||||
Advanced
|
||||
</button>
|
||||
<button
|
||||
v-if="authStore.role !== 'User'"
|
||||
class="join-item btn btn-sm btn-primary mt-1 duration-500"
|
||||
:class="activeConf === 3 && 'btn-secondary'"
|
||||
@click="activeConf = 3"
|
||||
|
@ -19,7 +19,6 @@
|
||||
{{ t('button.logging') }}
|
||||
</NuxtLink>
|
||||
<NuxtLink
|
||||
v-if="authStore.role.toLowerCase().includes('admin')"
|
||||
:to="localePath({ name: 'configure' })"
|
||||
class="btn join-item btn-primary px-2"
|
||||
>
|
||||
|
Loading…
Reference in New Issue
Block a user