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:
parent
a1279d7eb5
commit
334ad174a9
25 changed files with 420 additions and 391 deletions
|
@ -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({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue