CLOUDSTACK-1838: cloudstack UI - volume page - listView, detailView - hide hypervisor field when log in as regular-user/domain-admin.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/86a153c5 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/86a153c5 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/86a153c5 Branch: refs/heads/qemu-img Commit: 86a153c595d65049fcd1a93bca1bf3ef40364fd3 Parents: 34a59fc Author: Jessica Wang <[email protected]> Authored: Thu Mar 28 14:38:17 2013 -0700 Committer: Jessica Wang <[email protected]> Committed: Thu Mar 28 14:38:52 2013 -0700 ---------------------------------------------------------------------- ui/scripts/storage.js | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/86a153c5/ui/scripts/storage.js ---------------------------------------------------------------------- diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js index 5c19bd0..54605e2 100644 --- a/ui/scripts/storage.js +++ b/ui/scripts/storage.js @@ -34,6 +34,12 @@ listView: { id: 'volumes', label: 'label.volumes', + preFilter: function(args) { + var hiddenFields = []; + if(isAdmin() != true) + hiddenFields.push('hypervisor'); + return hiddenFields; + }, fields: { name: { label: 'label.name' }, type: { label: 'label.type' }, @@ -1113,7 +1119,7 @@ hiddenFields = []; } else { - hiddenFields = ["storage"]; + hiddenFields = ['storage', 'hypervisor']; } return hiddenFields; },
