瀏覽代碼

fix unit tests

Olivier Massot 2 年之前
父節點
當前提交
6f9db6cf71
共有 1 個文件被更改,包括 3 次插入0 次删除
  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' | '' = ''