accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject [1/3] ACCUMULO-1681 - Rolling in match (after merging)
Date Mon, 28 Oct 2013 23:10:41 GMT
Updated Branches:
  refs/heads/master e04fd1902 -> 9a2041d56


http://git-wip-us.apache.org/repos/asf/accumulo/blob/9a2041d5/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
index 5366b3b..0ddb752 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
@@ -17,8 +17,11 @@
 package org.apache.accumulo.test.randomwalk.security;
 
 import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
@@ -411,4 +414,14 @@ public class WalkingSecurity extends SecurityOperation implements Authorizor,
Au
     cs.add(PasswordToken.class);
     return cs;
   }
+  
+  @Override
+  public boolean isValidAuthorizations(String user, List<ByteBuffer> auths) throws
AccumuloSecurityException {
+    Collection<ByteBuffer> userauths = getCachedUserAuthorizations(user).getAuthorizationsBB();
+    for (ByteBuffer auth : auths)
+      if (!userauths.contains(auth))
+        return false;
+    return true;
+  }
+  
 }


Mime
View raw message