From 3db8100dcd12261b2541a62ad54a49a1a964c08f Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Sat, 31 Dec 2011 13:55:59 +0000 Subject: [PATCH] fix permissions mapping when array or not array git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1226093 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva-webapp-js/src/main/webapp/js/redback/roles.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/roles.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/roles.js index da018b3a5..6dc455e9d 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/roles.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/roles.js @@ -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); } -- 2.39.5