|
|
@ -25,7 +25,7 @@ export default {
|
|
|
|
Query: {
|
|
|
|
Query: {
|
|
|
|
participantById: (_: any, { id }: { id: any }, { dataSources, req }: { dataSources: any, req: any }) => {
|
|
|
|
participantById: (_: any, { id }: { id: any }, { dataSources, req }: { dataSources: any, req: any }) => {
|
|
|
|
if (req.permissions.includes(Permission.ReadParticipant)) {
|
|
|
|
if (req.permissions.includes(Permission.ReadParticipant)) {
|
|
|
|
return dataSources.participantAPI.getParticipantById(id);
|
|
|
|
return dataSources.participantAPI.participantById(id);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
throw new PermissionError();
|
|
|
|
throw new PermissionError();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -119,6 +119,10 @@ export default {
|
|
|
|
isLockedByMe: (parent: any, __: any, { req }: { req: any }) => isLockedByMe(parent, { req }),
|
|
|
|
isLockedByMe: (parent: any, __: any, { req }: { req: any }) => isLockedByMe(parent, { req }),
|
|
|
|
isLocked: (parent: any, __: any, { req }: { req: any }) => isLocked(parent, { req })
|
|
|
|
isLocked: (parent: any, __: any, { req }: { req: any }) => isLocked(parent, { req })
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
EngagementType: {
|
|
|
|
|
|
|
|
isLockedByMe: (parent: any, __: any, { req }: { req: any }) => isLockedByMe(parent, { req }),
|
|
|
|
|
|
|
|
isLocked: (parent: any, __: any, { req }: { req: any }) => isLocked(parent, { req })
|
|
|
|
|
|
|
|
},
|
|
|
|
Mutation: {
|
|
|
|
Mutation: {
|
|
|
|
createParticipant: (_: any, { participant }: { participant: any }, { dataSources, req }: { dataSources: any, req: any }) => {
|
|
|
|
createParticipant: (_: any, { participant }: { participant: any }, { dataSources, req }: { dataSources: any, req: any }) => {
|
|
|
|
if (req.permissions.includes(Permission.WriteParticipant)) {
|
|
|
|
if (req.permissions.includes(Permission.WriteParticipant)) {
|
|
|
|