asyncRetryTransactionMiddleware,
authenticate,
commonVideosFiltersValidator,
+ ensureCanManageChannel,
optionalAuthenticate,
paginationValidator,
setDefaultPagination,
videoPlaylistsSortValidator
} from '../../middlewares'
import {
- ensureAuthUserOwnsChannelValidator,
+ ensureIsLocalChannel,
videoChannelsFollowersSortValidator,
videoChannelsListValidator,
videoChannelsNameWithHostValidator,
authenticate,
reqAvatarFile,
asyncMiddleware(videoChannelsNameWithHostValidator),
- ensureAuthUserOwnsChannelValidator,
+ ensureIsLocalChannel,
+ ensureCanManageChannel,
updateAvatarValidator,
asyncMiddleware(updateVideoChannelAvatar)
)
authenticate,
reqBannerFile,
asyncMiddleware(videoChannelsNameWithHostValidator),
- ensureAuthUserOwnsChannelValidator,
+ ensureIsLocalChannel,
+ ensureCanManageChannel,
updateBannerValidator,
asyncMiddleware(updateVideoChannelBanner)
)
videoChannelRouter.delete('/:nameWithHost/avatar',
authenticate,
asyncMiddleware(videoChannelsNameWithHostValidator),
- ensureAuthUserOwnsChannelValidator,
+ ensureIsLocalChannel,
+ ensureCanManageChannel,
asyncMiddleware(deleteVideoChannelAvatar)
)
videoChannelRouter.delete('/:nameWithHost/banner',
authenticate,
asyncMiddleware(videoChannelsNameWithHostValidator),
- ensureAuthUserOwnsChannelValidator,
+ ensureIsLocalChannel,
+ ensureCanManageChannel,
asyncMiddleware(deleteVideoChannelBanner)
)
videoChannelRouter.put('/:nameWithHost',
authenticate,
asyncMiddleware(videoChannelsNameWithHostValidator),
- ensureAuthUserOwnsChannelValidator,
+ ensureIsLocalChannel,
+ ensureCanManageChannel,
videoChannelsUpdateValidator,
asyncRetryTransactionMiddleware(updateVideoChannel)
)
videoChannelRouter.delete('/:nameWithHost',
authenticate,
+ asyncMiddleware(videoChannelsNameWithHostValidator),
+ ensureIsLocalChannel,
+ ensureCanManageChannel,
asyncMiddleware(videoChannelsRemoveValidator),
asyncRetryTransactionMiddleware(removeVideoChannel)
)
videoChannelRouter.get('/:nameWithHost/followers',
authenticate,
asyncMiddleware(videoChannelsNameWithHostValidator),
- ensureAuthUserOwnsChannelValidator,
+ ensureCanManageChannel,
paginationValidator,
videoChannelsFollowersSortValidator,
setDefaultSort,