@knora/api
Version:
JavaScript library that handles API requests to Knora
41 lines • 2.07 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var operators_1 = require("rxjs/operators");
var api_response_data_1 = require("../../../models/api-response-data");
var endpoint_1 = require("../../endpoint");
var administrative_permission_response_1 = require("../../../models/admin/administrative-permission-response");
/**
* An endpoint for working with Knora permissions.
*/
var PermissionsEndpoint = /** @class */ (function (_super) {
__extends(PermissionsEndpoint, _super);
function PermissionsEndpoint() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* Gets the administrative permission for a project and group.
*
* @param projectIri The project IRI.
* @param groupIri The group IRI.
*/
PermissionsEndpoint.prototype.getAdministrativePermission = function (projectIri, groupIri) {
var _this = this;
return this.httpGet("/" + encodeURIComponent(projectIri) + "/" + encodeURIComponent(groupIri)).pipe(operators_1.map(function (ajaxResponse) { return api_response_data_1.ApiResponseData.fromAjaxResponse(ajaxResponse, administrative_permission_response_1.AdministrativePermissionResponse, _this.jsonConvert); }), operators_1.catchError(function (error) { return _this.handleError(error); }));
};
return PermissionsEndpoint;
}(endpoint_1.Endpoint));
exports.PermissionsEndpoint = PermissionsEndpoint;
//# sourceMappingURL=permissions-endpoint.js.map