Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 12F2910994 for ; Wed, 4 Dec 2013 23:57:55 +0000 (UTC) Received: (qmail 39920 invoked by uid 500); 4 Dec 2013 23:57:55 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 39896 invoked by uid 500); 4 Dec 2013 23:57:55 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 39889 invoked by uid 99); 4 Dec 2013 23:57:54 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Dec 2013 23:57:54 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id AA504320241; Wed, 4 Dec 2013 23:57:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ctubbsii@apache.org To: commits@accumulo.apache.org Date: Wed, 04 Dec 2013 23:58:02 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [10/50] [abbrv] git commit: ACCUMULO-1479 fixed minor problems that caused tests to fail, permissions still not fully implemented ACCUMULO-1479 fixed minor problems that caused tests to fail, permissions still not fully implemented Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/ad9abf46 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/ad9abf46 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/ad9abf46 Branch: refs/heads/1.6.0-SNAPSHOT Commit: ad9abf462eab4108394e510ee2d614b14a3a501e Parents: dfdf511 Author: Sean Hickey Authored: Thu Aug 1 15:15:39 2013 -0400 Committer: Christopher Tubbs Committed: Wed Dec 4 18:46:10 2013 -0500 ---------------------------------------------------------------------- .../accumulo/server/security/SecurityOperation.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/ad9abf46/server/base/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java b/server/base/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java index cad84d0..6dcaf9d 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java +++ b/server/base/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java @@ -26,6 +26,7 @@ import org.apache.accumulo.core.client.AccumuloSecurityException; import org.apache.accumulo.core.client.TableNamespaceNotFoundException; import org.apache.accumulo.core.client.TableNotFoundException; import org.apache.accumulo.core.client.admin.SecurityOperationsImpl; +import org.apache.accumulo.core.client.impl.TableNamespaces; import org.apache.accumulo.core.client.impl.Tables; import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode; import org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException; @@ -338,7 +339,12 @@ public class SecurityOperation { protected boolean hasTableNamespacePermissionForTableName(TCredentials credentials, String tableName, TableNamespacePermission permission, boolean useCached) throws ThriftSecurityException { String tableNamespace = Tables.extractNamespace(tableName); - return hasTableNamespacePermission(credentials, tableNamespace, permission, useCached); + try { + String namespace = TableNamespaces.getNamespaceId(HdfsZooInstance.getInstance(), tableNamespace); + return hasTableNamespacePermission(credentials, namespace, permission, useCached); + } catch (TableNamespaceNotFoundException e) { + return false; + } } /** @@ -792,8 +798,7 @@ public class SecurityOperation { public boolean canImport(TCredentials credentials, String tableName, String importDir) throws ThriftSecurityException { authenticate(credentials); - String tableId = Tables.getNamespace(HdfsZooInstance.getInstance(), tableName); return hasSystemPermission(credentials, SystemPermission.CREATE_TABLE, false) - || hasTableNamespacePermissionForTableId(credentials, tableId, TableNamespacePermission.CREATE_TABLE, false); + || hasTableNamespacePermissionForTableName(credentials, tableName, TableNamespacePermission.CREATE_TABLE, false); } }