fix:ロールタイムライン無効に関する修正 (#10843)

* 修正

* note visibility change

* public投稿のみ

* update changelog

* RN非表示機能がうごかないところだった
This commit is contained in:
nenohi 2023-05-19 17:12:22 +09:00 committed by GitHub
parent 02715f5d14
commit bd6666173a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 2 deletions

View file

@ -306,6 +306,14 @@ export class RoleService implements OnApplicationShutdown {
return user.isRoot || (await this.getUserRoles(user.id)).some(r => r.isAdministrator);
}
@bindThis
public async isExplorable(role: { id: Role['id']} | null): Promise<boolean> {
if (role == null) return false;
const check = await this.rolesRepository.findOneBy({ id: role.id });
if (check == null) return false;
return check.isExplorable;
}
@bindThis
public async getModeratorIds(includeAdmins = true): Promise<User['id'][]> {
const roles = await this.rolesCache.fetch(() => this.rolesRepository.findBy({}));