1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

Refactor account/channel manage checks

Use a more robust approach by requiring the caller to choose if it needs
to check the actor is local and/or the user can manage it
This commit is contained in:
Chocobozzz 2025-04-10 08:51:23 +02:00
parent a1279d7eb5
commit 334ad174a9
No known key found for this signature in database
GPG key ID: 583A612D890159BE
25 changed files with 420 additions and 391 deletions

View file

@ -23,7 +23,7 @@ export class ActorHtml {
}
static async getVideoChannelHTMLPage (nameWithHost: string, req: express.Request, res: express.Response) {
const videoChannel = await VideoChannelModel.loadByNameWithHostAndPopulateAccount(nameWithHost)
const videoChannel = await VideoChannelModel.loadByHandleAndPopulateAccount(nameWithHost)
return this.getAccountOrChannelHTMLPage({
loader: () => Promise.resolve(videoChannel),
@ -36,7 +36,7 @@ export class ActorHtml {
static async getActorHTMLPage (nameWithHost: string, req: express.Request, res: express.Response) {
const [ account, channel ] = await Promise.all([
AccountModel.loadByNameWithHost(nameWithHost),
VideoChannelModel.loadByNameWithHostAndPopulateAccount(nameWithHost)
VideoChannelModel.loadByHandleAndPopulateAccount(nameWithHost)
])
return this.getAccountOrChannelHTMLPage({