Skip to content

Commit

Permalink
モデレーターでもトークン発行画面にadmin系権限が表示されるように
Browse files Browse the repository at this point in the history
  • Loading branch information
FineArchs committed Nov 13, 2024
1 parent d237651 commit 5d8971f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/frontend/src/components/MkTokenGenerateWindow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<div class="_gaps_s">
<MkSwitch v-for="kind in Object.keys(permissionSwitches)" :key="kind" v-model="permissionSwitches[kind]">{{ i18n.ts._permissions[kind] }}</MkSwitch>
</div>
<div v-if="iAmAdmin" :class="$style.adminPermissions">
<div v-if="iAmModerator" :class="$style.adminPermissions">
<div :class="$style.adminPermissionsHeader"><b>{{ i18n.ts.adminPermission }}</b></div>
<div class="_gaps_s">
<MkSwitch v-for="kind in Object.keys(permissionSwitchesForAdmin)" :key="kind" v-model="permissionSwitchesForAdmin[kind]">{{ i18n.ts._permissions[kind] }}</MkSwitch>
Expand All @@ -55,7 +55,7 @@ import MkButton from './MkButton.vue';
import MkInfo from './MkInfo.vue';
import MkModalWindow from '@/components/MkModalWindow.vue';
import { i18n } from '@/i18n.js';
import { iAmAdmin } from '@/account.js';
import { iAmModerator } from '@/account.js';

const props = withDefaults(defineProps<{
title?: string | null;
Expand Down Expand Up @@ -91,7 +91,7 @@ if (props.initialPermissions) {
permissionSwitches.value[kind] = false;
}

if (iAmAdmin) {
if (iAmModerator) {
for (const kind of adminPermissions) {
permissionSwitchesForAdmin.value[kind] = false;
}
Expand All @@ -103,7 +103,7 @@ function ok(): void {
name: name.value,
permissions: [
...Object.keys(permissionSwitches.value).filter(p => permissionSwitches.value[p]),
...(iAmAdmin ? Object.keys(permissionSwitchesForAdmin.value).filter(p => permissionSwitchesForAdmin.value[p]) : []),
...(iAmModerator ? Object.keys(permissionSwitchesForAdmin.value).filter(p => permissionSwitchesForAdmin.value[p]) : []),
],
});
dialog.value?.close();
Expand All @@ -113,7 +113,7 @@ function disableAll(): void {
for (const p in permissionSwitches.value) {
permissionSwitches.value[p] = false;
}
if (iAmAdmin) {
if (iAmModerator) {
for (const p in permissionSwitchesForAdmin.value) {
permissionSwitchesForAdmin.value[p] = false;
}
Expand All @@ -124,7 +124,7 @@ function enableAll(): void {
for (const p in permissionSwitches.value) {
permissionSwitches.value[p] = true;
}
if (iAmAdmin) {
if (iAmModerator) {
for (const p in permissionSwitchesForAdmin.value) {
permissionSwitchesForAdmin.value[p] = true;
}
Expand Down

0 comments on commit 5d8971f

Please sign in to comment.