This commit is contained in:
syuilo 2023-06-10 17:41:52 +09:00
parent c59a30ec09
commit 46222d0258
9 changed files with 5 additions and 36 deletions

2
locales/index.d.ts vendored
View File

@ -1431,8 +1431,6 @@ export interface Locale {
"isConditionalRole": string; "isConditionalRole": string;
"isPublic": string; "isPublic": string;
"descriptionOfIsPublic": string; "descriptionOfIsPublic": string;
"isPublicUsers": string;
"descriptionOfIsPublicUsers": string;
"options": string; "options": string;
"policies": string; "policies": string;
"baseRole": string; "baseRole": string;

View File

@ -1352,10 +1352,8 @@ _role:
conditional: "コンディショナル" conditional: "コンディショナル"
condition: "条件" condition: "条件"
isConditionalRole: "これはコンディショナルロールです。" isConditionalRole: "これはコンディショナルロールです。"
isPublic: "ロールを公開" isPublic: "公開ロール"
descriptionOfIsPublic: "ユーザーのプロフィールでこのロールが表示されます。" descriptionOfIsPublic: "ユーザーのプロフィールでこのロールが表示されます。"
isPublicUsers: "ユーザーリストを公開"
descriptionOfIsPublicUsers: "ロールにアサインされたユーザーのリストを誰でも見ることができます。"
options: "オプション" options: "オプション"
policies: "ポリシー" policies: "ポリシー"
baseRole: "ベースロール" baseRole: "ベースロール"
@ -1364,8 +1362,8 @@ _role:
iconUrl: "アイコン画像のURL" iconUrl: "アイコン画像のURL"
asBadge: "バッジとして表示" asBadge: "バッジとして表示"
descriptionOfAsBadge: "オンにすると、ユーザー名の横にロールのアイコンが表示されます。" descriptionOfAsBadge: "オンにすると、ユーザー名の横にロールのアイコンが表示されます。"
isExplorable: "ロールタイムラインを公開" isExplorable: "ユーザーを見つけやすくする"
descriptionOfIsExplorable: "オンにすると、ロールのタイムラインを公開します。ロールの公開がオフの場合、タイムラインの公開はされません。" descriptionOfIsExplorable: "オンにすると、「みつける」でメンバー一覧が公開されるほか、ロールのタイムラインが利用可能になります。"
displayOrder: "表示順" displayOrder: "表示順"
descriptionOfDisplayOrder: "数値が大きいほどUI上で先頭に表示されます。" descriptionOfDisplayOrder: "数値が大きいほどUI上で先頭に表示されます。"
canEditMembersByModerator: "モデレーターのメンバー編集を許可" canEditMembersByModerator: "モデレーターのメンバー編集を許可"

View File

@ -1,11 +0,0 @@
export class roleuserhidden1686381571997 {
name = 'roleuserhidden1686381571997'
async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "role" ADD "isPublicUsers" boolean NOT NULL DEFAULT true`);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "role" DROP COLUMN "isPublicUsers"`);
}
}

View File

@ -167,11 +167,6 @@ export class Role {
}) })
public displayOrder: number; public displayOrder: number;
@Column('boolean', {
default: true,
})
public isPublicUsers: boolean;
@Column('jsonb', { @Column('jsonb', {
default: { }, default: { },
}) })

View File

@ -26,7 +26,6 @@ export const paramDef = {
isModerator: { type: 'boolean' }, isModerator: { type: 'boolean' },
isAdministrator: { type: 'boolean' }, isAdministrator: { type: 'boolean' },
isExplorable: { type: 'boolean', default: false }, // optional for backward compatibility isExplorable: { type: 'boolean', default: false }, // optional for backward compatibility
isPublicUsers: { type: 'boolean', default: true }, // optional for backward compatibility
asBadge: { type: 'boolean' }, asBadge: { type: 'boolean' },
canEditMembersByModerator: { type: 'boolean' }, canEditMembersByModerator: { type: 'boolean' },
displayOrder: { type: 'number' }, displayOrder: { type: 'number' },
@ -79,7 +78,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
isAdministrator: ps.isAdministrator, isAdministrator: ps.isAdministrator,
isModerator: ps.isModerator, isModerator: ps.isModerator,
isExplorable: ps.isExplorable, isExplorable: ps.isExplorable,
isPublicUsers: ps.isPublicUsers,
asBadge: ps.asBadge, asBadge: ps.asBadge,
canEditMembersByModerator: ps.canEditMembersByModerator, canEditMembersByModerator: ps.canEditMembersByModerator,
displayOrder: ps.displayOrder, displayOrder: ps.displayOrder,

View File

@ -34,7 +34,6 @@ export const paramDef = {
isModerator: { type: 'boolean' }, isModerator: { type: 'boolean' },
isAdministrator: { type: 'boolean' }, isAdministrator: { type: 'boolean' },
isExplorable: { type: 'boolean' }, isExplorable: { type: 'boolean' },
isPublicUsers: { type: 'boolean' },
asBadge: { type: 'boolean' }, asBadge: { type: 'boolean' },
canEditMembersByModerator: { type: 'boolean' }, canEditMembersByModerator: { type: 'boolean' },
displayOrder: { type: 'number' }, displayOrder: { type: 'number' },
@ -88,7 +87,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
isModerator: ps.isModerator, isModerator: ps.isModerator,
isAdministrator: ps.isAdministrator, isAdministrator: ps.isAdministrator,
isExplorable: ps.isExplorable, isExplorable: ps.isExplorable,
isPublicUsers: ps.isPublicUsers,
asBadge: ps.asBadge, asBadge: ps.asBadge,
canEditMembersByModerator: ps.canEditMembersByModerator, canEditMembersByModerator: ps.canEditMembersByModerator,
displayOrder: ps.displayOrder, displayOrder: ps.displayOrder,

View File

@ -30,6 +30,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const roles = await this.rolesRepository.findBy({ const roles = await this.rolesRepository.findBy({
isPublic: true, isPublic: true,
isExplorable: true,
}); });
return await this.roleEntityService.packMany(roles, me); return await this.roleEntityService.packMany(roles, me);
}); });

View File

@ -49,14 +49,12 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
const role = await this.rolesRepository.findOneBy({ const role = await this.rolesRepository.findOneBy({
id: ps.roleId, id: ps.roleId,
isPublic: true, isPublic: true,
isExplorable: true,
}); });
if (role == null) { if (role == null) {
throw new ApiError(meta.errors.noSuchRole); throw new ApiError(meta.errors.noSuchRole);
} }
if (!role.isPublicUsers) {
return [];
}
const query = this.queryService.makePaginationQuery(this.roleAssignmentsRepository.createQueryBuilder('assign'), ps.sinceId, ps.untilId) const query = this.queryService.makePaginationQuery(this.roleAssignmentsRepository.createQueryBuilder('assign'), ps.sinceId, ps.untilId)
.andWhere('assign.roleId = :roleId', { roleId: role.id }) .andWhere('assign.roleId = :roleId', { roleId: role.id })

View File

@ -63,11 +63,6 @@
<template #caption>{{ i18n.ts._role.descriptionOfIsExplorable }}</template> <template #caption>{{ i18n.ts._role.descriptionOfIsExplorable }}</template>
</MkSwitch> </MkSwitch>
<MkSwitch v-model="role.isPublicUsers" :readonly="readonly">
<template #label>{{ i18n.ts._role.isPublicUsers }}</template>
<template #caption>{{ i18n.ts._role.descriptionOfIsPublicUsers }}</template>
</MkSwitch>
<FormSlot> <FormSlot>
<template #label><i class="ti ti-license"></i> {{ i18n.ts._role.policies }}</template> <template #label><i class="ti ti-license"></i> {{ i18n.ts._role.policies }}</template>
<div class="_gaps_s"> <div class="_gaps_s">
@ -506,7 +501,6 @@ const save = throttle(100, () => {
isModerator: role.isModerator, isModerator: role.isModerator,
isPublic: role.isPublic, isPublic: role.isPublic,
isExplorable: role.isExplorable, isExplorable: role.isExplorable,
isPublicUsers: role.isPublicUsers,
asBadge: role.asBadge, asBadge: role.asBadge,
canEditMembersByModerator: role.canEditMembersByModerator, canEditMembersByModerator: role.canEditMembersByModerator,
policies: role.policies, policies: role.policies,