add isBlank
This commit is contained in:
parent
e805759af5
commit
85657d1c32
3 changed files with 39 additions and 18 deletions
|
|
@ -48,9 +48,9 @@ export class PermissionOrgController extends Controller {
|
|||
*/
|
||||
@Get()
|
||||
async GetActiveRootIdAdmin(@Request() request: RequestWithUser) {
|
||||
if (!request.user.role.includes("SUPER_ADMIN")) {
|
||||
throw new HttpError(HttpStatus.FORBIDDEN, "ไม่มีสิทธิ์ใช้งานระบบนี้");
|
||||
}
|
||||
// if (!request.user.role.includes("SUPER_ADMIN")) {
|
||||
// throw new HttpError(HttpStatus.FORBIDDEN, "ไม่มีสิทธิ์ใช้งานระบบนี้");
|
||||
// }
|
||||
const orgRevisionActive = await this.orgRevisionRepository.findOne({
|
||||
where: { orgRevisionIsCurrent: false, orgRevisionIsDraft: true },
|
||||
});
|
||||
|
|
@ -76,9 +76,9 @@ export class PermissionOrgController extends Controller {
|
|||
searchField?: "fullName" | "position" | "posNo" | "postype" | "poslevel",
|
||||
@Query() searchKeyword: string = "",
|
||||
) {
|
||||
if (!request.user.role.includes("SUPER_ADMIN")) {
|
||||
throw new HttpError(HttpStatus.FORBIDDEN, "ไม่มีสิทธิ์ใช้งานระบบนี้");
|
||||
}
|
||||
// if (!request.user.role.includes("SUPER_ADMIN")) {
|
||||
// throw new HttpError(HttpStatus.FORBIDDEN, "ไม่มีสิทธิ์ใช้งานระบบนี้");
|
||||
// }
|
||||
let queryLike =
|
||||
"CONCAT(profile.prefix, profile.firstName, ' ', profile.lastName) LIKE :keyword";
|
||||
if (searchField == "postype") {
|
||||
|
|
@ -233,9 +233,9 @@ export class PermissionOrgController extends Controller {
|
|||
searchKeyword: string;
|
||||
},
|
||||
) {
|
||||
if (!request.user.role.includes("SUPER_ADMIN")) {
|
||||
throw new HttpError(HttpStatus.FORBIDDEN, "ไม่มีสิทธิ์ใช้งานระบบนี้");
|
||||
}
|
||||
// if (!request.user.role.includes("SUPER_ADMIN")) {
|
||||
// throw new HttpError(HttpStatus.FORBIDDEN, "ไม่มีสิทธิ์ใช้งานระบบนี้");
|
||||
// }
|
||||
let profiles: any = [];
|
||||
if (requestBody.id != null) {
|
||||
const _permissionOrg = await this.orgRootRepository.findOne({
|
||||
|
|
@ -423,9 +423,9 @@ export class PermissionOrgController extends Controller {
|
|||
@Request() request: RequestWithUser,
|
||||
@Body() requestBody: { nodeId: string; personId: string },
|
||||
) {
|
||||
if (!request.user.role.includes("SUPER_ADMIN")) {
|
||||
throw new HttpError(HttpStatus.FORBIDDEN, "ไม่มีสิทธิ์ใช้งานระบบนี้");
|
||||
}
|
||||
// if (!request.user.role.includes("SUPER_ADMIN")) {
|
||||
// throw new HttpError(HttpStatus.FORBIDDEN, "ไม่มีสิทธิ์ใช้งานระบบนี้");
|
||||
// }
|
||||
const orgRoot = await this.orgRootRepository.findOne({
|
||||
where: { id: requestBody.nodeId },
|
||||
});
|
||||
|
|
@ -472,9 +472,9 @@ export class PermissionOrgController extends Controller {
|
|||
*/
|
||||
@Delete("{id}")
|
||||
async Delete(@Request() request: RequestWithUser, @Path() id: string) {
|
||||
if (!request.user.role.includes("SUPER_ADMIN")) {
|
||||
throw new HttpError(HttpStatus.FORBIDDEN, "ไม่มีสิทธิ์ใช้งานระบบนี้");
|
||||
}
|
||||
// if (!request.user.role.includes("SUPER_ADMIN")) {
|
||||
// throw new HttpError(HttpStatus.FORBIDDEN, "ไม่มีสิทธิ์ใช้งานระบบนี้");
|
||||
// }
|
||||
// const orgRoot = await this.orgRootRepository.findOne({
|
||||
// where: { id: nodeId },
|
||||
// relations: ["permissionOrgRoots"],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue