feat: filter responsible only
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 4s
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 4s
This commit is contained in:
parent
4dbe89f290
commit
92104c05cb
1 changed files with 19 additions and 3 deletions
|
|
@ -32,6 +32,7 @@ import { notFoundError } from "../utils/error";
|
||||||
import { deleteFile, fileLocation, getFile, getPresigned, listFile, setFile } from "../utils/minio";
|
import { deleteFile, fileLocation, getFile, getPresigned, listFile, setFile } from "../utils/minio";
|
||||||
import HttpError from "../interfaces/http-error";
|
import HttpError from "../interfaces/http-error";
|
||||||
import HttpStatus from "../interfaces/http-status";
|
import HttpStatus from "../interfaces/http-status";
|
||||||
|
import { getGroupUser } from "../services/keycloak";
|
||||||
|
|
||||||
// User in company can edit.
|
// User in company can edit.
|
||||||
const permissionCheck = createPermCheck((_) => true);
|
const permissionCheck = createPermCheck((_) => true);
|
||||||
|
|
@ -136,9 +137,24 @@ export class RequestDataController extends Controller {
|
||||||
workflow: {
|
workflow: {
|
||||||
step: {
|
step: {
|
||||||
some: {
|
some: {
|
||||||
responsiblePerson: {
|
OR: [
|
||||||
some: { userId: req.user.sub },
|
{
|
||||||
},
|
responsiblePerson: {
|
||||||
|
some: { userId: req.user.sub },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
responsibleGroup: {
|
||||||
|
some: {
|
||||||
|
group: {
|
||||||
|
in: await getGroupUser(req.user.sub).then((r) =>
|
||||||
|
r.map(({ name }: { name: string }) => name),
|
||||||
|
),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue