Skip to content

Commit

Permalink
Merge pull request #1150 from bcgov/feature/ALCS-1287-2
Browse files Browse the repository at this point in the history
Covenant Bug Fixes
  • Loading branch information
dhaselhan authored Nov 9, 2023
2 parents 3248aab + e839980 commit cba129f
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
grid-column-gap: 36px;
grid-row-gap: 12px;
margin-bottom: 12px;
overflow-y: hidden;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
grid-column-gap: rem(36);
grid-row-gap: rem(12);
margin-bottom: rem(12);
overflow-y: hidden;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
grid-column-gap: rem(36);
grid-row-gap: rem(12);
margin-bottom: rem(12);
overflow-y: hidden;
}
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,7 @@ describe('ApplicationSubmissionService', () => {
new ApplicationDocument({}),
new User({
uuid: 'user_uuid',
clientRoles: [],
}),
);

Expand All @@ -721,6 +722,7 @@ describe('ApplicationSubmissionService', () => {
new ApplicationDocument({}),
new User({
uuid: 'NOT_user_uuid',
clientRoles: [],
}),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,13 @@ export class ApplicationSubmissionService {
}

async canDeleteDocument(document: ApplicationDocument, user: User) {
const overlappingRoles = ROLES_ALLOWED_APPLICATIONS.filter((value) =>
user.clientRoles!.includes(value),
);
if (overlappingRoles.length > 0) {
return true;
}

const documentFlags = await this.getDocumentFlags(document);

const isOwner = user.uuid === documentFlags.ownerUuid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ describe('NoticeOfIntentSubmissionService', () => {
new NoticeOfIntentDocument({}),
new User({
uuid: 'user_uuid',
clientRoles: [],
}),
);

Expand All @@ -514,6 +515,7 @@ describe('NoticeOfIntentSubmissionService', () => {
new NoticeOfIntentDocument({}),
new User({
uuid: 'NOT_user_uuid',
clientRoles: [],
}),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,13 @@ export class NoticeOfIntentSubmissionService {
}

async canDeleteDocument(document: NoticeOfIntentDocument, user: User) {
const overlappingRoles = ROLES_ALLOWED_APPLICATIONS.filter((value) =>
user.clientRoles!.includes(value),
);
if (overlappingRoles.length > 0) {
return true;
}

const documentFlags = await this.getDocumentFlags(document);

const isOwner = user.uuid === documentFlags.ownerUuid;
Expand Down

0 comments on commit cba129f

Please sign in to comment.