@studyportals/client-internal-platform-authorization
Advanced tools
Comparing version 1.3.0 to 1.4.0
{ | ||
"name": "@studyportals/client-internal-platform-authorization", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "Typescript library containing resources that facilitate performing user privileges checks for operations exposed in client and internal facing products.", | ||
@@ -15,3 +15,3 @@ "main": "bin/index.js", | ||
"deploy-major": "npm version major && npm run deploy", | ||
"deploy": "npm run prepare-deployment && npm publish bin", | ||
"deploy": "npm run prepare-deployment && npm publish bin --otp=448569", | ||
"deploy-beta": "npm version prerelease && npm run prepare-deployment && npm publish bin --tag beta", | ||
@@ -35,3 +35,3 @@ "lint": "tslint 'src/**/*.ts'", | ||
"mocha-typescript": "1.1.10", | ||
"nyc": "^13.1.0", | ||
"nyc": "^15.1.0", | ||
"tslint": "^5.11.0", | ||
@@ -38,0 +38,0 @@ "typemoq": "^2.1.0", |
@@ -60,3 +60,3 @@ /** | ||
/** | ||
* Checks whether the specified user can approve Student Matching Tool enrolment batches. | ||
* Checks whether the specified user can approve enrolment input batches. | ||
* | ||
@@ -63,0 +63,0 @@ * @param username |
@@ -9,2 +9,3 @@ import { ISuperAgentRequestFactory } from "@studyportals/mb-platform-http-requests"; | ||
constructor(requestFactory: ISuperAgentRequestFactory, baseUrl?: string); | ||
hasInternalAccess(username: string): Promise<boolean>; | ||
canGenerateReports(username: string): Promise<boolean>; | ||
@@ -11,0 +12,0 @@ canDeleteReports(username: string): Promise<boolean>; |
@@ -22,2 +22,9 @@ "use strict"; | ||
} | ||
hasInternalAccess(username) { | ||
const request = this.requestsFactory.post(`${this.baseUrl}internal`); | ||
return new Promise((resolve) => { | ||
request.send({ username: username }); | ||
request.end((err, res) => this.handleAuthorizationRequest(err, res, resolve)); | ||
}); | ||
} | ||
canGenerateReports(username) { | ||
@@ -24,0 +31,0 @@ const request = this.requestsFactory.post(`${this.baseUrl}reports/generate`); |
Sorry, the diff of this file is not supported yet
17093
208