mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-25 11:45:12 +00:00
ロールのユーザーリストを非公開にできるように (#10987)
* ロールのユーザーリストを非公開にできるように * Changelog update
This commit is contained in:
parent
f69627939b
commit
f3a16bcd6d
9 changed files with 45 additions and 1 deletions
11
CHANGELOG.md
11
CHANGELOG.md
|
@ -11,6 +11,17 @@
|
|||
-
|
||||
|
||||
-->
|
||||
## 13.x.x (unreleased)
|
||||
|
||||
### General
|
||||
- ロールが付与されているユーザーリストを非公開にできるように
|
||||
|
||||
### Client
|
||||
-
|
||||
|
||||
### Server
|
||||
-
|
||||
|
||||
|
||||
## 13.13.1
|
||||
|
||||
|
|
2
locales/index.d.ts
vendored
2
locales/index.d.ts
vendored
|
@ -1431,6 +1431,8 @@ export interface Locale {
|
|||
"isConditionalRole": string;
|
||||
"isPublic": string;
|
||||
"descriptionOfIsPublic": string;
|
||||
"isPublicUsers": string;
|
||||
"descriptionOfIsPublicUsers": string;
|
||||
"options": string;
|
||||
"policies": string;
|
||||
"baseRole": string;
|
||||
|
|
|
@ -1353,7 +1353,9 @@ _role:
|
|||
condition: "条件"
|
||||
isConditionalRole: "これはコンディショナルロールです。"
|
||||
isPublic: "ロールを公開"
|
||||
descriptionOfIsPublic: "ロールにアサインされたユーザーを誰でも見ることができます。また、ユーザーのプロフィールでこのロールが表示されます。"
|
||||
descriptionOfIsPublic: "ユーザーのプロフィールでこのロールが表示されます。"
|
||||
isPublicUsers: "ユーザーリストを公開"
|
||||
descriptionOfIsPublicUsers: "ロールにアサインされたユーザーのリストを誰でも見ることができます。"
|
||||
options: "オプション"
|
||||
policies: "ポリシー"
|
||||
baseRole: "ベースロール"
|
||||
|
|
11
packages/backend/migration/1686381571997-roleuserhidden.js
Normal file
11
packages/backend/migration/1686381571997-roleuserhidden.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
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"`);
|
||||
}
|
||||
}
|
|
@ -167,6 +167,11 @@ export class Role {
|
|||
})
|
||||
public displayOrder: number;
|
||||
|
||||
@Column('boolean', {
|
||||
default: true,
|
||||
})
|
||||
public isPublicUsers: boolean;
|
||||
|
||||
@Column('jsonb', {
|
||||
default: { },
|
||||
})
|
||||
|
|
|
@ -26,6 +26,7 @@ export const paramDef = {
|
|||
isModerator: { type: 'boolean' },
|
||||
isAdministrator: { type: 'boolean' },
|
||||
isExplorable: { type: 'boolean', default: false }, // optional for backward compatibility
|
||||
isPublicUsers: { type: 'boolean', default: true }, // optional for backward compatibility
|
||||
asBadge: { type: 'boolean' },
|
||||
canEditMembersByModerator: { type: 'boolean' },
|
||||
displayOrder: { type: 'number' },
|
||||
|
@ -78,6 +79,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
|||
isAdministrator: ps.isAdministrator,
|
||||
isModerator: ps.isModerator,
|
||||
isExplorable: ps.isExplorable,
|
||||
isPublicUsers: ps.isPublicUsers,
|
||||
asBadge: ps.asBadge,
|
||||
canEditMembersByModerator: ps.canEditMembersByModerator,
|
||||
displayOrder: ps.displayOrder,
|
||||
|
|
|
@ -34,6 +34,7 @@ export const paramDef = {
|
|||
isModerator: { type: 'boolean' },
|
||||
isAdministrator: { type: 'boolean' },
|
||||
isExplorable: { type: 'boolean' },
|
||||
isPublicUsers: { type: 'boolean' },
|
||||
asBadge: { type: 'boolean' },
|
||||
canEditMembersByModerator: { type: 'boolean' },
|
||||
displayOrder: { type: 'number' },
|
||||
|
@ -87,6 +88,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
|||
isModerator: ps.isModerator,
|
||||
isAdministrator: ps.isAdministrator,
|
||||
isExplorable: ps.isExplorable,
|
||||
isPublicUsers: ps.isPublicUsers,
|
||||
asBadge: ps.asBadge,
|
||||
canEditMembersByModerator: ps.canEditMembersByModerator,
|
||||
displayOrder: ps.displayOrder,
|
||||
|
|
|
@ -54,6 +54,9 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
|||
if (role == null) {
|
||||
throw new ApiError(meta.errors.noSuchRole);
|
||||
}
|
||||
if (!role.isPublicUsers) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const query = this.queryService.makePaginationQuery(this.roleAssignmentsRepository.createQueryBuilder('assign'), ps.sinceId, ps.untilId)
|
||||
.andWhere('assign.roleId = :roleId', { roleId: role.id })
|
||||
|
|
|
@ -63,6 +63,11 @@
|
|||
<template #caption>{{ i18n.ts._role.descriptionOfIsExplorable }}</template>
|
||||
</MkSwitch>
|
||||
|
||||
<MkSwitch v-model="role.isPublicUsers" :readonly="readonly">
|
||||
<template #label>{{ i18n.ts._role.isPublicUsers }}</template>
|
||||
<template #caption>{{ i18n.ts._role.descriptionOfIsPublicUsers }}</template>
|
||||
</MkSwitch>
|
||||
|
||||
<FormSlot>
|
||||
<template #label><i class="ti ti-license"></i> {{ i18n.ts._role.policies }}</template>
|
||||
<div class="_gaps_s">
|
||||
|
@ -501,6 +506,7 @@ const save = throttle(100, () => {
|
|||
isModerator: role.isModerator,
|
||||
isPublic: role.isPublic,
|
||||
isExplorable: role.isExplorable,
|
||||
isPublicUsers: role.isPublicUsers,
|
||||
asBadge: role.asBadge,
|
||||
canEditMembersByModerator: role.canEditMembersByModerator,
|
||||
policies: role.policies,
|
||||
|
|
Loading…
Reference in a new issue