fix:ロールタイムライン無効に関する修正 (#10843)
* 修正 * note visibility change * public投稿のみ * update changelog * RN非表示機能がうごかないところだった
This commit is contained in:
parent
02715f5d14
commit
bd6666173a
5 changed files with 22 additions and 2 deletions
|
@ -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({}));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue