use of org.apache.hadoop.registry.server.integration.RMRegistryOperationsService in project hadoop by apache.
the class TestSecureRMRegistryOperations method testUserHomedirsPermissionsRestricted.
@Test
public void testUserHomedirsPermissionsRestricted() throws Throwable {
// test that the /users/$user permissions are restricted
RMRegistryOperationsService rmRegistryOperations = startRMRegistryOperations();
// create Alice's dir, so it should have an ACL for Alice
final String home = rmRegistryOperations.initUserRegistry(ALICE);
List<ACL> acls = rmRegistryOperations.zkGetACLS(home);
ACL aliceACL = null;
for (ACL acl : acls) {
LOG.info(RegistrySecurity.aclToString(acl));
Id id = acl.getId();
if (id.getScheme().equals(ZookeeperConfigOptions.SCHEME_SASL) && id.getId().startsWith(ALICE)) {
aliceACL = acl;
break;
}
}
assertNotNull(aliceACL);
assertEquals(RegistryAdminService.USER_HOMEDIR_ACL_PERMISSIONS, aliceACL.getPerms());
}
use of org.apache.hadoop.registry.server.integration.RMRegistryOperationsService in project jstorm by alibaba.
the class Executor method setupInitialRegistryPaths.
/**
* TODO: purge this once RM is doing the work
*
* @throws IOException
*/
protected void setupInitialRegistryPaths() throws IOException {
if (registryOperations instanceof RMRegistryOperationsService) {
RMRegistryOperationsService rmRegOperations = (RMRegistryOperationsService) registryOperations;
rmRegOperations.initUserRegistryAsync(RegistryUtils.currentUser());
}
}
Aggregations