X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fmodels%2Fusers%2Fuser-role.ts;h=ae3a0d983ea294ce9fe3deb7663b6f82352f9be8;hb=7cd1b12c19d0589d1d692ed0571ca0800f028aea;hp=59c2ba10656a63a896ca8a429c437ff0e367fe69;hpb=73471b1a52f242e86364ffb077ea6cadb3b07ae2;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/models/users/user-role.ts b/shared/models/users/user-role.ts index 59c2ba106..ae3a0d983 100644 --- a/shared/models/users/user-role.ts +++ b/shared/models/users/user-role.ts @@ -7,15 +7,13 @@ export enum UserRole { USER = 2 } -// TODO: use UserRole for key once https://github.com/Microsoft/TypeScript/issues/13042 is fixed -export const USER_ROLE_LABELS: { [ id: number ]: string } = { +export const USER_ROLE_LABELS: { [ id in UserRole ]: string } = { [UserRole.USER]: 'User', [UserRole.MODERATOR]: 'Moderator', [UserRole.ADMINISTRATOR]: 'Administrator' } -// TODO: use UserRole for key once https://github.com/Microsoft/TypeScript/issues/13042 is fixed -const userRoleRights: { [ id: number ]: UserRight[] } = { +const userRoleRights: { [ id in UserRole ]: UserRight[] } = { [UserRole.ADMINISTRATOR]: [ UserRight.ALL ], @@ -25,6 +23,7 @@ const userRoleRights: { [ id: number ]: UserRight[] } = { UserRight.MANAGE_VIDEO_ABUSES, UserRight.REMOVE_ANY_VIDEO, UserRight.REMOVE_ANY_VIDEO_CHANNEL, + UserRight.REMOVE_ANY_VIDEO_PLAYLIST, UserRight.REMOVE_ANY_VIDEO_COMMENT, UserRight.UPDATE_ANY_VIDEO, UserRight.SEE_ALL_VIDEOS,