Compare commits

...

8 Commits

Author SHA1 Message Date
kakkokari-gtyih 7201cd30d0 🎨 2026-01-24 03:33:50 +09:00
kakkokari-gtyih b1eb28b153 fix: build autogen files 2026-01-24 02:08:48 +09:00
copilot-swe-agent[bot] cd767b237e Add frontend UI for canCreateChannel policy configuration
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
2026-01-22 12:33:07 +00:00
copilot-swe-agent[bot] 7c5c0afe13 Add canCreateChannel to misskey-js rolePolicies array
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
2026-01-22 12:22:01 +00:00
copilot-swe-agent[bot] ecdfc6bd6e Add canCreateChannel translations for en-US and ja-JP
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
2026-01-22 12:21:15 +00:00
copilot-swe-agent[bot] 52df703cd2 Add canCreateChannel to getUserPolicies return value
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
2026-01-22 12:20:16 +00:00
copilot-swe-agent[bot] d4c2d840d7 Add canCreateChannel role policy to control channel creation
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
2026-01-22 12:17:38 +00:00
copilot-swe-agent[bot] b383bf9848 Initial plan 2026-01-22 12:14:53 +00:00
12 changed files with 48 additions and 2 deletions

View File

@ -2096,6 +2096,7 @@ _role:
canSearchNotes: "Usage of note search"
canSearchUsers: "User search"
canUseTranslator: "Translator usage"
canCreateChannel: "Can create channels"
avatarDecorationLimit: "Maximum number of avatar decorations"
canImportAntennas: "Can import antennas"
canImportBlocking: "Can import blocking"

View File

@ -2121,6 +2121,7 @@ _role:
canSearchNotes: "ノート検索の利用"
canSearchUsers: "ユーザー検索の利用"
canUseTranslator: "翻訳機能の利用"
canCreateChannel: "チャンネルの作成"
avatarDecorationLimit: "アイコンデコレーションの最大取付個数"
canImportAntennas: "アンテナのインポートを許可"
canImportBlocking: "ブロックのインポートを許可"

View File

@ -47,6 +47,7 @@ export type RolePolicies = {
canSearchUsers: boolean;
canUseTranslator: boolean;
canHideAds: boolean;
canCreateChannel: boolean;
driveCapacityMb: number;
maxFileSizeMb: number;
alwaysMarkNsfw: boolean;
@ -88,6 +89,7 @@ export const DEFAULT_POLICIES: RolePolicies = {
canSearchUsers: true,
canUseTranslator: true,
canHideAds: false,
canCreateChannel: true,
driveCapacityMb: 100,
maxFileSizeMb: 30,
alwaysMarkNsfw: false,
@ -410,6 +412,7 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit {
canSearchUsers: calc('canSearchUsers', vs => vs.some(v => v === true)),
canUseTranslator: calc('canUseTranslator', vs => vs.some(v => v === true)),
canHideAds: calc('canHideAds', vs => vs.some(v => v === true)),
canCreateChannel: calc('canCreateChannel', vs => vs.some(v => v === true)),
driveCapacityMb: calc('driveCapacityMb', vs => Math.max(...vs)),
maxFileSizeMb: calc('maxFileSizeMb', vs => Math.max(...vs)),
alwaysMarkNsfw: calc('alwaysMarkNsfw', vs => vs.some(v => v === true)),

View File

@ -224,6 +224,10 @@ export const packedRolePoliciesSchema = {
type: 'boolean',
optional: false, nullable: false,
},
canCreateChannel: {
type: 'boolean',
optional: false, nullable: false,
},
driveCapacityMb: {
type: 'integer',
optional: false, nullable: false,

View File

@ -22,6 +22,8 @@ export const meta = {
kind: 'write:channels',
requiredRolePolicy: 'canCreateChannel',
limit: {
duration: ms('1hour'),
max: 10,

View File

@ -387,6 +387,26 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.canCreateChannel, 'canCreateChannel'])">
<template #label>{{ i18n.ts._role._options.canCreateChannel }}</template>
<template #suffix>
<span v-if="role.policies.canCreateChannel.useDefault" :class="$style.useDefaultLabel">{{ i18n.ts._role.useBaseValue }}</span>
<span v-else>{{ role.policies.canCreateChannel.value ? i18n.ts.yes : i18n.ts.no }}</span>
<span :class="$style.priorityIndicator"><i :class="getPriorityIcon(role.policies.canCreateChannel)"></i></span>
</template>
<div class="_gaps">
<MkSwitch v-model="role.policies.canCreateChannel.useDefault" :readonly="readonly">
<template #label>{{ i18n.ts._role.useBaseValue }}</template>
</MkSwitch>
<MkSwitch v-model="role.policies.canCreateChannel.value" :disabled="role.policies.canCreateChannel.useDefault" :readonly="readonly">
<template #label>{{ i18n.ts.enable }}</template>
</MkSwitch>
<MkRange v-model="role.policies.canCreateChannel.priority" :min="0" :max="2" :step="1" easing :textConverter="(v) => v === 0 ? i18n.ts._role._priority.low : v === 1 ? i18n.ts._role._priority.middle : v === 2 ? i18n.ts._role._priority.high : ''">
<template #label>{{ i18n.ts._role.priority }}</template>
</MkRange>
</div>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.driveCapacity, 'driveCapacityMb'])">
<template #label>{{ i18n.ts._role._options.driveCapacity }}</template>
<template #suffix>

View File

@ -142,6 +142,14 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkSwitch>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.canCreateChannel, 'canCreateChannel'])">
<template #label>{{ i18n.ts._role._options.canCreateChannel }}</template>
<template #suffix>{{ policies.canCreateChannel ? i18n.ts.yes : i18n.ts.no }}</template>
<MkSwitch v-model="policies.canCreateChannel">
<template #label>{{ i18n.ts.enable }}</template>
</MkSwitch>
</MkFolder>
<MkFolder v-if="matchQuery([i18n.ts._role._options.driveCapacity, 'driveCapacityMb'])">
<template #label>{{ i18n.ts._role._options.driveCapacity }}</template>
<template #suffix>{{ policies.driveCapacityMb }}MB</template>

View File

@ -50,7 +50,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkPagination>
</div>
<div v-else-if="tab === 'owned'" class="_gaps">
<MkButton link primary rounded to="/channels/new"><i class="ti ti-plus"></i> {{ i18n.ts.createNew }}</MkButton>
<MkButton v-if="$i?.policies.canCreateChannel" link primary rounded to="/channels/new"><i class="ti ti-plus"></i> {{ i18n.ts.createNew }}</MkButton>
<MkPagination v-slot="{items}" :paginator="ownedPaginator">
<div :class="$style.root">
<MkChannelPreview v-for="channel in items" :key="channel.id" :channel="channel"/>
@ -74,6 +74,7 @@ import { definePage } from '@/page.js';
import { i18n } from '@/i18n.js';
import { useRouter } from '@/router.js';
import { Paginator } from '@/utility/paginator.js';
import { $i } from '@/i.js';
const router = useRouter();

View File

@ -8173,6 +8173,10 @@ export interface Locale extends ILocale {
*
*/
"canUseTranslator": string;
/**
*
*/
"canCreateChannel": string;
/**
*
*/

View File

@ -3466,7 +3466,7 @@ type RoleLite = components['schemas']['RoleLite'];
type RolePolicies = components['schemas']['RolePolicies'];
// @public (undocumented)
export const rolePolicies: readonly ["gtlAvailable", "ltlAvailable", "canPublicNote", "mentionLimit", "canInvite", "inviteLimit", "inviteLimitCycle", "inviteExpirationTime", "canManageCustomEmojis", "canManageAvatarDecorations", "canSearchNotes", "canSearchUsers", "canUseTranslator", "canHideAds", "driveCapacityMb", "maxFileSizeMb", "alwaysMarkNsfw", "canUpdateBioMedia", "pinLimit", "antennaLimit", "wordMuteLimit", "webhookLimit", "clipLimit", "noteEachClipsLimit", "userListLimit", "userEachUserListsLimit", "rateLimitFactor", "avatarDecorationLimit", "canImportAntennas", "canImportBlocking", "canImportFollowing", "canImportMuting", "canImportUserLists", "chatAvailability", "uploadableFileTypes", "noteDraftLimit", "scheduledNoteLimit", "watermarkAvailable"];
export const rolePolicies: readonly ["gtlAvailable", "ltlAvailable", "canPublicNote", "mentionLimit", "canInvite", "inviteLimit", "inviteLimitCycle", "inviteExpirationTime", "canManageCustomEmojis", "canManageAvatarDecorations", "canSearchNotes", "canSearchUsers", "canUseTranslator", "canHideAds", "canCreateChannel", "driveCapacityMb", "maxFileSizeMb", "alwaysMarkNsfw", "canUpdateBioMedia", "pinLimit", "antennaLimit", "wordMuteLimit", "webhookLimit", "clipLimit", "noteEachClipsLimit", "userListLimit", "userEachUserListsLimit", "rateLimitFactor", "avatarDecorationLimit", "canImportAntennas", "canImportBlocking", "canImportFollowing", "canImportMuting", "canImportUserLists", "chatAvailability", "uploadableFileTypes", "noteDraftLimit", "scheduledNoteLimit", "watermarkAvailable"];
// @public (undocumented)
type RolesListResponse = operations['roles___list']['responses']['200']['content']['application/json'];

View File

@ -5322,6 +5322,7 @@ export type components = {
canSearchUsers: boolean;
canUseTranslator: boolean;
canHideAds: boolean;
canCreateChannel: boolean;
driveCapacityMb: number;
maxFileSizeMb: number;
uploadableFileTypes: string[];

View File

@ -205,6 +205,7 @@ export const rolePolicies = [
'canSearchUsers',
'canUseTranslator',
'canHideAds',
'canCreateChannel',
'driveCapacityMb',
'maxFileSizeMb',
'alwaysMarkNsfw',