X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fmodels%2Fusers%2Fuser-role.ts;h=ae3a0d983ea294ce9fe3deb7663b6f82352f9be8;hb=7cd1b12c19d0589d1d692ed0571ca0800f028aea;hp=d7020c0f2bf5b7a4bd339d51eb66e4fe23058e29;hpb=1cd3facc3de899ac864e979cd6d6a704b712cce3;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/models/users/user-role.ts b/shared/models/users/user-role.ts index d7020c0f2..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,9 +23,13 @@ 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 + UserRight.SEE_ALL_VIDEOS, + UserRight.MANAGE_ACCOUNTS_BLOCKLIST, + UserRight.MANAGE_SERVERS_BLOCKLIST, + UserRight.MANAGE_USERS ], [UserRole.USER]: []