Просмотр исходного кода

fix: #2508,string type not equal will still pass (#2523)

Nuoky 7 лет назад
Родитель
Сommit
e11cb4afb2
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/components/Authorized/CheckPermissions.js

+ 1 - 1
src/components/Authorized/CheckPermissions.js

@@ -48,7 +48,7 @@ const checkPermissions = (authority, currentAuthority, target, Exception) => {
     if (Array.isArray(currentAuthority)) {
       for (let i = 0; i < currentAuthority.length; i += 1) {
         const element = currentAuthority[i];
-        if (authority.indexOf(element) >= 0) {
+        if (authority === element) {
           return target;
         }
       }