Skip to content

Commit 596f951

Browse files
Merge pull request #393 from gjsjohnmurray/fix-392
fix #392 no longer require %SYS namespace access for 'Add Server Namespace to Workspace' command
2 parents febbdc4 + cbefb44 commit 596f951

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/api/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,12 +340,16 @@ export class AtelierAPI {
340340
}
341341
}
342342

343+
/**
344+
* Use the serverInfo endpoint. Connection object does not need to have specified a namespace when instantiated.
345+
*/
343346
public serverInfo(): Promise<Atelier.Response<Atelier.Content<Atelier.ServerInfo>>> {
344347
return this.request(0, "GET").then((info) => {
345348
if (info && info.result && info.result.content && info.result.content.api > 0) {
346349
const data = info.result.content;
347350
const apiVersion = data.api;
348-
if (!data.namespaces.includes(this.ns.toUpperCase())) {
351+
// If this is a namespace-specific connection, throw if it doesn't exist or if the user has no access to it
352+
if (this.ns && !data.namespaces.includes(this.ns.toUpperCase())) {
349353
throw {
350354
code: "WrongNamespace",
351355
message: `This server does not have specified namespace '${this.ns}'.\n

src/commands/addServerNamespaceToWorkspace.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export async function addServerNamespaceToWorkspace(): Promise<void> {
2424
return;
2525
}
2626
// Get its namespace list
27-
let uri = vscode.Uri.parse(`isfs://${serverName}/?ns=%SYS`);
27+
let uri = vscode.Uri.parse(`isfs://${serverName}/`);
2828
await resolveConnectionSpec(serverName);
2929
// Prepare a displayable form of its connection spec as a hint to the user
3030
const connSpec = await serverManagerApi.getServerSpec(serverName);

0 commit comments

Comments
 (0)