List of usage examples for org.apache.hadoop.security.authorize AccessControlList getAclString
public String getAclString()
From source file:probos.TestStaticMethods.java
License:Open Source License
@Test public void testPolicy() throws Exception { Configuration c = new Configuration(); ServiceAuthorizationManager sam = new ServiceAuthorizationManager(); System.setProperty("hadoop.policy.file", "probos-policy.xml"); sam.refreshWithLoadedConfiguration(c, new ControllerPolicyProvider()); AccessControlList acl = sam.getProtocolsAcls(PBSClient.class); assertNotNull(acl);/*from w ww.ja v a 2s .com*/ assertEquals("*", acl.getAclString()); assertTrue(acl .isUserAllowed(UserGroupInformation.createUserForTesting("testUser", new String[] { "mygroup" }))); sam.authorize(UserGroupInformation.getCurrentUser(), PBSClient.class, c, InetAddress.getLocalHost()); }