Explorar o código

fix unit tests

Olivier Massot %!s(int64=2) %!d(string=hai) anos
pai
achega
6f9db6cf71
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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' | '' = ''