]> source.dussan.org Git - archiva.git/commitdiff
fix permissions mapping when array or not array
authorOlivier Lamy <olamy@apache.org>
Sat, 31 Dec 2011 13:55:59 +0000 (13:55 +0000)
committerOlivier Lamy <olamy@apache.org>
Sat, 31 Dec 2011 13:55:59 +0000 (13:55 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1226093 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/roles.js

index da018b3a561bad090b768b605dbeaa0d3bccbe4b..6dc455e9d27c69e5f2287b3313be658c4c673b11 100644 (file)
@@ -116,9 +116,9 @@ $(function() {
       return mapUser(item);
     }):null;
 
-    var permissions = data.permissions? $.map(data.permissions, function(item){
+    var permissions = data.permissions? $.isArray(data.permissions) ? $.map(data.permissions, function(item){
       return mapPermission(item);
-    }):null;
+    }): new Array(mapPermission(data.permissions)) :null;
 
     return new role(data.name, data.description,data.assignable,childRoleNames,parentRoleNames,users,parentsRolesUsers,permissions);
   }