]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commit
Give moderators access to edit channels (#4608)
authorkontrollanten <6680299+kontrollanten@users.noreply.github.com>
Mon, 13 Dec 2021 14:29:13 +0000 (15:29 +0100)
committerGitHub <noreply@github.com>
Mon, 13 Dec 2021 14:29:13 +0000 (15:29 +0100)
commita37e9e74ff07b057370d1ed6c0b391a02be8a6d2
tree30d59e12518149a309bbd10bee1485f8be523c75
parent11e520b50d791a0dd48cbb2d0fc681b25eb7cd53
Give moderators access to edit channels (#4608)

* give admins access to edit all channels

closes #4598

* test(channels): +admin update another users channel

* Fix tests

* fix(server): delete another users channel

Since the channel owner isn't necessary the auth user we need to check
the right account whether it's the last video or not.

* REMOVE_ANY_VIDEO_CHANNEL > MANAGE_ANY_VIDEO_CHANNEL

Merge REMOVE_ANY_VIDEO_CHANNEL and MANY_VIDEO_CHANNELS to
MANAGE_ANY_VIDEO_CHANNEL.

* user-right: moderator can't manage admins channel

* client: MyVideoChannelCreateComponent > VideoChannelCreateComponent

* client: MyVideoChannelEdit > VideoChannelEdit

* Revert "user-right: moderator can't manage admins channel"

This reverts commit 2c627c154e2bfe6af2e0f45efb27faf4117572f3.

* server: clean dupl validator functionality

* fix ensureUserCanManageChannel usage

It's not async anymore.

* server: merge channel validator middleares

ensureAuthUserOwnsChannelValidator & ensureUserCanManageChannel gets
merged into one middleware.

* client(VideoChannelEdit): redirect to prev route

* fix(VideoChannels): handle anon users

* client: new routes for create/update channel

* Refactor channel validators

Co-authored-by: Chocobozzz <me@florianbigard.com>
27 files changed:
client/src/app/+manage/manage-routing.module.ts [new file with mode: 0644]
client/src/app/+manage/manage.module.ts [new file with mode: 0644]
client/src/app/+manage/video-channel-edit/video-channel-create.component.ts [moved from client/src/app/+my-library/+my-video-channels/my-video-channel-create.component.ts with 91% similarity]
client/src/app/+manage/video-channel-edit/video-channel-edit.component.html [new file with mode: 0644]
client/src/app/+manage/video-channel-edit/video-channel-edit.component.scss [moved from client/src/app/+my-library/+my-video-channels/my-video-channel-edit.component.scss with 96% similarity]
client/src/app/+manage/video-channel-edit/video-channel-edit.ts [moved from client/src/app/+my-library/+my-video-channels/my-video-channel-edit.ts with 85% similarity]
client/src/app/+manage/video-channel-edit/video-channel-update.component.ts [moved from client/src/app/+my-library/+my-video-channels/my-video-channel-update.component.ts with 89% similarity]
client/src/app/+my-library/+my-video-channels/my-video-channel-edit.component.html [deleted file]
client/src/app/+my-library/+my-video-channels/my-video-channels-routing.module.ts
client/src/app/+my-library/+my-video-channels/my-video-channels.component.html
client/src/app/+my-library/+my-video-channels/my-video-channels.module.ts
client/src/app/+video-channels/video-channels.component.html
client/src/app/+video-channels/video-channels.component.ts
client/src/app/+video-channels/video-channels.module.ts
client/src/app/app-routing.module.ts
client/src/app/core/routing/redirect.service.ts
server/controllers/activitypub/client.ts
server/controllers/activitypub/inbox.ts
server/controllers/activitypub/outbox.ts
server/controllers/api/video-channel.ts
server/middlewares/validators/shared/video-channels.ts
server/middlewares/validators/users.ts
server/middlewares/validators/videos/video-channels.ts
server/tests/api/videos/video-channels.ts
shared/core-utils/users/user-role.ts
shared/extra-utils/users/users-command.ts
shared/models/users/user-right.enum.ts