use of org.apache.curator.framework.api.ACLProvider in project incubator-atlas by apache.
the class CuratorFactory method getAclProvider.
private ACLProvider getAclProvider(HAConfiguration.ZookeeperProperties zookeeperProperties) {
ACLProvider aclProvider = null;
if (zookeeperProperties.hasAcl()) {
final ACL acl = AtlasZookeeperSecurityProperties.parseAcl(zookeeperProperties.getAcl());
LOG.info("Setting ACL for id {} with scheme {} and perms {}.", getIdForLogging(acl.getId().getScheme(), acl.getId().getId()), acl.getId().getScheme(), acl.getPerms());
LOG.info("Current logged in user: {}", getCurrentUser());
final List<ACL> acls = Arrays.asList(acl);
aclProvider = new ACLProvider() {
@Override
public List<ACL> getDefaultAcl() {
return acls;
}
@Override
public List<ACL> getAclForPath(String path) {
return acls;
}
};
}
return aclProvider;
}
Aggregations