Skip to content

PSP-11664 Remove Contractor Permissions for Specified Region#5354

Open
asanchezr wants to merge 13 commits into
bcgov:devfrom
asanchezr:psp-11664-fix-contractor-access
Open

PSP-11664 Remove Contractor Permissions for Specified Region#5354
asanchezr wants to merge 13 commits into
bcgov:devfrom
asanchezr:psp-11664-fix-contractor-access

Conversation

@asanchezr

Copy link
Copy Markdown
Collaborator

No description provided.

@asanchezr asanchezr self-assigned this Jul 9, 2026
}
};

var context = helper.CreatePimsContext(user, true).AddAndSaveChanges(contractorFile);
}
};

var context = helper.CreatePimsContext(user, true).AddAndSaveChanges(outOfRegionFile);
}
};

var context = helper.CreatePimsContext(user, true).AddAndSaveChanges(inRegionFile);
// Assert
// PersonId should be passed to ensure contractor only sees leases they are assigned to
leaseRepository.Verify(x => x.GetPage(filter, user.PersonId), Times.Once);
leaseRepository.Verify(x => x.GetPage(filter, It.Is<UserContextModel>(uc => uc.PersonId == user.PersonId && uc.IsContractor == true)), Times.Once);
@sonarqubecloud

sonarqubecloud Bot commented Jul 9, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

See CodeCov Report Here: https://app.codecov.io/github/bcgov/psp/pull/5354

1 similar comment
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

See CodeCov Report Here: https://app.codecov.io/github/bcgov/psp/pull/5354

@eddherrera eddherrera left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although the code looks good I am moderately concerned about the fact that methods at the repository level became heavily dependent and tightly coupled on a "UserContext" which may not always be the case when have other services making calls to the API.
I see other changes not related to the scope of the ticket like 'Appsettings' and 'project' settings and changes on ports configurations that would have been better on a sepparate PR.
And the last thing would be the TICKET number in comments, which I believe we don't have a convention and would be nice to agree upon.
Please take a note on the project settings changes and communicate to us on the Dev meeting.

@mergify

mergify Bot commented Jul 10, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants