]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/custom-validators/users.ts
Merge branch 'release/4.2.0' into develop
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / users.ts
index 105c366002fc271d40f548042634bdc3af402309..b04970108ef5171174af2509d2ba36b63f2959c0 100644 (file)
@@ -90,7 +90,7 @@ function isUserBlockedReasonValid (value: any) {
 }
 
 function isUserRoleValid (value: any) {
-  return exists(value) && validator.isInt('' + value) && UserRole[value] !== undefined
+  return exists(value) && validator.isInt('' + value) && [ UserRole.ADMINISTRATOR, UserRole.MODERATOR, UserRole.USER ].includes(value)
 }
 
 // ---------------------------------------------------------------------------