μλ
νμΈμ!
var APICURIO_SHARE_FOR_EVERYONE νκ²½μ μλνμ΅λλ€.
λ€λ₯Έ μ¬μ©μμ APIλ₯Ό λ³΄κ³ νΈμ§ν μ μμ§λ§ " Collaborators " λλ " Mocks "λ₯Ό λ³Ό μ μμ΅λλ€.
μμΈμ κ²μνλ©΄ μ¬μ©μμκ² κΆνμ΄ μκΈ° λλ¬Έμ "getMocks" μλΉμ€κ° "isShareForEveryone()" μμ±μ νμΈνμ§ μκ³ 404 HTTP μ€λ₯ Satusλ₯Ό λ°ννλ κ²μΌλ‘ λνλ¬μ΅λλ€. "νλ ₯μ" μΉμ λ λ§μ°¬κ°μ§μ λλ€.
this.endpoint("/designs/:designId/mocks",
```
public getMocks(apiId: string, from?: number, to?: number): μ½μ
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): μ½μ
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 λ°μ {
μ μ = 0;
μ μ = 20;
if (μμ != null) {
from = start.intValue();
}
if (λ != 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.
λ―Έμν©λλ€.
μ±μ μ λ°μ΄νΈνκ² μ΅λλ€.
μ€λ₯λ₯Ό 무μν μ μμ΅λλ€.
κ°μ¬ ν΄μ.