read env var from conf file directly

This commit is contained in:
Khalid Huseynov 2016-11-14 01:57:51 +09:00
parent 28abffac6a
commit 496b80c082

View file

@ -62,7 +62,6 @@ public class NotebookAuthorization {
private static ZeppelinConfiguration conf;
private static Gson gson;
private static String filePath;
private static boolean isPublic;
private NotebookAuthorization() {}
@ -74,7 +73,6 @@ public class NotebookAuthorization {
GsonBuilder builder = new GsonBuilder();
builder.setPrettyPrinting();
gson = builder.create();
isPublic = config.isNotebokPublic();
try {
loadFromFile();
} catch (IOException e) {
@ -158,6 +156,10 @@ public class NotebookAuthorization {
LOG.error("Error saving notebook authorization file: " + e.getMessage());
}
}
public boolean isPublic() {
return conf.isNotebokPublic();
}
private Set<String> validateUser(Set<String> users) {
Set<String> returnUser = new HashSet<>();
@ -330,7 +332,7 @@ public class NotebookAuthorization {
public void setNewNotePermissions(String noteId, AuthenticationInfo subject) {
if (!AuthenticationInfo.isAnonymous(subject)) {
if (isPublic) {
if (isPublic()) {
// add current user to owners - can be public
Set<String> owners = getOwners(noteId);
owners.add(subject.getUser());