mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
read env var from conf file directly
This commit is contained in:
parent
28abffac6a
commit
496b80c082
1 changed files with 5 additions and 3 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Reference in a new issue