Merge branch 'develop' of github.com:Frappet/bma-ehr-organization into develop
This commit is contained in:
commit
5a25772daa
3 changed files with 25 additions and 4 deletions
|
|
@ -12,6 +12,7 @@ import { Profile } from "../entities/Profile";
|
|||
import { AuthSys } from "../entities/AuthSys";
|
||||
import { promisify } from "util";
|
||||
import { In } from "typeorm";
|
||||
import permission from "../interfaces/permission";
|
||||
const REDIS_HOST = process.env.REDIS_HOST;
|
||||
const REDIS_PORT = process.env.REDIS_PORT;
|
||||
|
||||
|
|
@ -187,4 +188,25 @@ export class PermissionController extends Controller {
|
|||
|
||||
return new HttpSuccess(reply);
|
||||
}
|
||||
|
||||
/**
|
||||
* API permission (dotnet api)
|
||||
* @summary permission (dotnet api)
|
||||
* @param {string} method Method
|
||||
* @param {string} system authSysId
|
||||
*/
|
||||
@Get("dotnet/{method}/{system}")
|
||||
public async dotnet(
|
||||
@Request() req: RequestWithUser,
|
||||
@Path() method: string,
|
||||
@Path() system: string
|
||||
) {
|
||||
|
||||
if(!["CREATE", "DELETE", "GET", "LIST", "UPDATE"].includes(method)) {
|
||||
throw new HttpError(HttpStatus.NOT_FOUND, "Method ไม่ถูกต้อง");
|
||||
}
|
||||
|
||||
let res = await new permission().Permission(req, system.toLocaleUpperCase(), method);
|
||||
return new HttpSuccess(res);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue