やあ!
私は環境変数APICURIO_SHARE_FOR_EVERYONEを試していました。
他のユーザーのAPIを表示および編集できますが、「コラボレーター」または「モック」が表示されません。
原因を検索したところ、ユーザーに権限がないため、サービス「getMocks」がプロパティ「isShareForEveryone()」をチェックせず、404HTTPエラーSatusを返すことがわかりました。 「コラボレーター」セクションについても同じです。
this.endpoint( "/ designs /:designId / mocks"、
`` `
public getMocks(apiId:string、from?:number、to?:number):Promise
let getMocksUrl: string = this.endpoint("/designs/:designId/mocks", {
designId: apiId
}, {
start: from,
end: to
});
let options: any = this.options({ "Accept": "application/json" });
console.info("[ApisService] Fetching API mocks: %s", getMocksUrl);
return this.httpGet<ApiMock[]>(getMocksUrl, options);
}
> this.endpoint("/designs/:designId/collaborators",
public getCollaborators(apiId:string):Promise
let getCollaboratorsUrl: string = this.endpoint("/designs/:designId/collaborators", {
designId: apiId
});
let options: any = this.options({ "Accept": "application/json" });
console.info("[ApisService] Fetching collaborator list: %s", getCollaboratorsUrl);
return this.httpGet<ApiCollaborator[]>(getCollaboratorsUrl, options);
}
**https://github.com/Apicurio/apicurio-studio/blob/master/back-end/hub-api/src/main/java/io/apicurio/hub/api/rest/impl/DesignsResource.java**
> !this.storage.hasWritePermission
@オーバーライド
パブリックコレクション
ServerError、NotFoundExceptionをスローします{
int from = 0;
int to = 20;
if(start!= null){
from = start.intValue();
}
if(end!= null){
to = end.intValue();
}
try {
String user = this.security.getCurrentUser().getLogin();
if (!this.storage.hasWritePermission(user, designId)) {
throw new NotFoundException();
}
return this.storage.listApiDesignMocks(designId, from, to);
} catch (StorageException e) {
throw new ServerError(e);
}
}
@オーバーライド
パブリックコレクション
logger.debug( "APIのすべてのコラボレーターを取得しています:{}"、designId);
metrics.apiCall( "/ designs / {designId} / collaborators"、 "GET");
try {
String user = this.security.getCurrentUser().getLogin();
if (!this.storage.hasWritePermission(user, designId)) {
throw new NotFoundException();
}
return this.storage.listPermissions(designId);
} catch (StorageException e) {
throw new ServerError(e);
}
}
`` `
バグレポートをありがとう。
@AguRyan最新のリリースでは、 hasWritePermission()
関数内で、 isShareForEveryone()
がチェックされていることがわかりました。
この問題の原因について他に何か考えがありますか?
やあ! コメントありがとうございます。バグを探していますが、古いバージョンを使用していたことがわかりました。 0.2.27。
申し訳ありません。
アプリを更新します。
エラーを閉じることができます。
ありがとう。
最も参考になるコメント
やあ! コメントありがとうございます。バグを探していますが、古いバージョンを使用していたことがわかりました。 0.2.27。
申し訳ありません。
アプリを更新します。
エラーを閉じることができます。
ありがとう。