Allow restricting announcement to a set of roles. Fix MkRoleSelectDialog only respecting publicOnly half the time

Closes #682
This commit is contained in:
наб 2025-07-13 00:37:17 +02:00
parent 5dd32123a3
commit f3b5c3f447
No known key found for this signature in database
GPG key ID: BCFD0B018D2658F1
12 changed files with 96 additions and 1 deletions

View file

@ -6,6 +6,7 @@
import { Entity, Index, Column, PrimaryColumn, ManyToOne, JoinColumn } from 'typeorm';
import { id } from './util/id.js';
import { MiUser } from './User.js';
import { MiRole } from './Role.js';
@Entity('announcement')
export class MiAnnouncement {
@ -66,6 +67,12 @@ export class MiAnnouncement {
})
public forExistingUsers: boolean;
@Column('text', {
array: true,
default: null, nullable: true,
})
public forRoles: MiRole['id'][] | null;
@Index()
@Column('boolean', {
default: false,