Parcourir la source

fix unit tests

Olivier Massot il y a 2 ans
Parent
commit
6f9db6cf71
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3 0
      services/rights/roleUtils.ts

+ 3 - 0
services/rights/roleUtils.ts

@@ -97,6 +97,9 @@ class RoleUtils {
   static parseRole(role: string): Role {
     const parts = role.split('_')
 
+    if (parts[0] !== 'ROLE') {
+      throw new Error('can not parse role')
+    }
     parts.shift()
 
     let action: 'VIEW' | 'CORE' | 'REFERENCE' | '' = ''