|
|
@ -21,6 +21,8 @@ public class RemoteWorkspace implements Workspace { |
|
|
|
|
|
|
|
|
|
|
|
private final WorkspaceConnectionInfo connection; |
|
|
|
private final WorkspaceConnectionInfo connection; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private volatile Boolean isRoot = null; |
|
|
|
|
|
|
|
|
|
|
|
RemoteWorkspace(WorkspaceClient client, WorkspaceConnectionInfo connection) { |
|
|
|
RemoteWorkspace(WorkspaceClient client, WorkspaceConnectionInfo connection) { |
|
|
|
|
|
|
|
|
|
|
|
this.client = client; |
|
|
|
this.client = client; |
|
|
@ -54,11 +56,15 @@ public class RemoteWorkspace implements Workspace { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean isRoot() { |
|
|
|
public boolean isRoot() { |
|
|
|
try { |
|
|
|
|
|
|
|
return WorkContext.getCurrent().get(DecisionOperator.class).isRoot(getConnection().getUserName()); |
|
|
|
if (isRoot == null) { |
|
|
|
} catch (Exception e) { |
|
|
|
synchronized (this) { |
|
|
|
return false; |
|
|
|
if (isRoot == null) { |
|
|
|
|
|
|
|
isRoot = WorkContext.getCurrent().get(DecisionOperator.class).isRoot(getConnection().getUserName()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return isRoot; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -88,6 +94,6 @@ public class RemoteWorkspace implements Workspace { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean equals(Object obj) { |
|
|
|
public boolean equals(Object obj) { |
|
|
|
|
|
|
|
|
|
|
|
return obj != null && obj instanceof RemoteWorkspace && AssistUtils.equals(((RemoteWorkspace) obj).connection, this.connection); |
|
|
|
return obj instanceof RemoteWorkspace && AssistUtils.equals(((RemoteWorkspace) obj).connection, this.connection); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|