no message

This commit is contained in:
kittapath 2024-10-21 17:38:20 +07:00
parent 7aeafcd723
commit 093b2ea73e
2 changed files with 20 additions and 1 deletions

View file

@ -707,7 +707,7 @@ export class WorkflowController extends Controller {
* @summary * @summary
* *
*/ */
@Post("keycloak/isofficer/{system}") @Post("keycloak/isofficer")
async checkPermissionWorkflow( async checkPermissionWorkflow(
@Request() req: RequestWithUser, @Request() req: RequestWithUser,
@Body() @Body()

View file

@ -180,6 +180,25 @@ class CheckAuth {
} }
}); });
} }
public async Workflow(req: RequestWithUser, id: string) {
if (
req.headers.hasOwnProperty("api_key") &&
req.headers["api_key"] &&
req.headers["api_key"] == process.env.API_KEY
) {
return null;
}
return await new CallAPI()
.PostData(req, "/org/workflow/keycloak/isofficer", {
refId: id,
})
.then((x) => {
return true;
})
.catch((x) => {
return false;
});
}
public async PermissionCreate(req: RequestWithUser, system: string) { public async PermissionCreate(req: RequestWithUser, system: string) {
return await this.Permission(req, system, "CREATE"); return await this.Permission(req, system, "CREATE");
} }