diff options
author | Christian W. Damus | 2013-10-09 20:48:10 +0000 |
---|---|---|
committer | Christian W. Damus | 2013-10-09 21:04:35 +0000 |
commit | 6717d1fe38952d3f3defc3f472441414cabadc73 (patch) | |
tree | 3c1405230ec784072684ea44394b8db47885773c | |
parent | d2985af11843438052b74f482dba65c410d1f0c3 (diff) | |
download | cdo-6717d1fe38952d3f3defc3f472441414cabadc73.tar.gz cdo-6717d1fe38952d3f3defc3f472441414cabadc73.tar.xz cdo-6717d1fe38952d3f3defc3f472441414cabadc73.zip |
419085: [Security] CDOItemProvider raises NoPermissionException on folders
https://bugs.eclipse.org/bugs/show_bug.cgi?id=419085
Guard CDOItemProvider::getChildren() on non-readable CDOResourceFolders as for hasChildren().
-rw-r--r-- | plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java index 2c12579932..48cd52c141 100644 --- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java +++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007-2013 Eike Stepper (Berlin, Germany) and others. + * Copyright (c) 2007-2013 Eike Stepper (Berlin, Germany), CEA LIST, and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -8,6 +8,7 @@ * Contributors: * Eike Stepper - initial API and implementation * Victor Roldan Betancort - maintenance + * Christian W. Damus (CEA LIST) - 418452 */ package org.eclipse.emf.cdo.ui; @@ -179,7 +180,12 @@ public class CDOItemProvider extends ContainerItemProvider<IContainer<Object>> if (element instanceof CDOResourceFolder) { - return ((CDOResourceFolder)element).getNodes().toArray(); + CDOResourceFolder folder = (CDOResourceFolder)element; + if (folder.cdoPermission() == CDOPermission.NONE) + { + return NO_ELEMENTS; + } + return folder.getNodes().toArray(); } return super.getChildren(element); |