Skip to content

PSP-10920 Access permissions for for Lease/Licence screens and related list-view reports#5208

Merged
asanchezr merged 8 commits intobcgov:devfrom
asanchezr:psp-10920-contractor-access-exports
Feb 21, 2026
Merged

PSP-10920 Access permissions for for Lease/Licence screens and related list-view reports#5208
asanchezr merged 8 commits intobcgov:devfrom
asanchezr:psp-10920-contractor-access-exports

Conversation

@asanchezr
Copy link
Copy Markdown
Collaborator

No description provided.

@asanchezr asanchezr self-assigned this Feb 13, 2026
@asanchezr asanchezr added the enhancement New feature or request label Feb 13, 2026
Comment thread source/backend/api/Areas/Reports/Controllers/LeaseController.cs Fixed
@github-actions
Copy link
Copy Markdown
Contributor

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

Comment thread source/backend/api/Models/Report/LeasePaymentReportModel.cs Fixed
Comment thread source/backend/api/Models/Report/LeasePaymentReportModel.cs Fixed
Comment thread source/backend/api/Models/Report/LeasePaymentReportModel.cs Fixed
Comment thread source/backend/api/Models/Report/LeasePaymentReportModel.cs Fixed
Comment thread source/backend/api/Models/Report/LeasePaymentReportModel.cs Fixed
Comment thread source/backend/api/Models/Report/LeasePaymentReportModel.cs Fixed
Comment thread source/backend/api/Models/Report/LeasePaymentReportModel.cs Fixed
@github-actions
Copy link
Copy Markdown
Contributor

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

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

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

}
}

predicate = predicate.And(acquisitionPredicate.Or(leasePredicate));
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.

Didn't check this locally, but acquisitionPredicate and leasePredicate seem to be initialized with true, and only filtered when includeAcquisitions or includeLeases is true.

If one of those is false, the predicate would remain true which would seem to be a problem given the Or statement.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

You are right. I'm putting a fix to initialize the predicates to false when their respective flag is disabled, so the Or doesn't swallow everything:

var acquisitionPredicate = PredicateBuilder.New<PimsCompReqFinancial>(includeAcquisitions);
// ...
var leasePredicate = PredicateBuilder.New<PimsCompReqFinancial>(includeLeases);

Comment thread source/backend/api/Services/LeaseReportsService.cs
if (contractorPersonId is not null)
{
query = query.Where(p => p.LeasePeriod.Lease.PimsLeaseLicenseTeams.Any(lt => lt.PersonId == contractorPersonId) ||
p.LeasePeriod.Lease.Project.PimsProjectPeople.Any(pp => pp.PersonId == contractorPersonId));
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.

Project isn't a required field is it? can this throw an NPE?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

good catch - will fix

@asanchezr asanchezr force-pushed the psp-10920-contractor-access-exports branch from 6a57e4a to 3e91cef Compare February 20, 2026 23:32
@github-actions
Copy link
Copy Markdown
Contributor

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

@asanchezr asanchezr added this pull request to the merge queue Feb 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

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

return PidTranslator.ConvertPIDToDash(property.Pid.ToString());
}

if (property?.Pin != null)

Check warning

Code scanning / CodeQL

Constant condition Warning

Condition is always false because of
... != ...
.
return PidTranslator.ConvertPIDToDash(property.Pid.ToString());
}

if (property?.Pin != null)

Check warning

Code scanning / CodeQL

Constant condition Warning

Condition is always null because of
... != ...
.
return property.Pin.ToString();
}

if (property?.Address != null && !string.IsNullOrEmpty(property.Address.StreetAddress1))

Check warning

Code scanning / CodeQL

Constant condition Warning

Condition is always false because of
... != ...
.
Condition is always false because of
... != ...
.
return property.Pin.ToString();
}

if (property?.Address != null && !string.IsNullOrEmpty(property.Address.StreetAddress1))

Check warning

Code scanning / CodeQL

Constant condition Warning

Condition is always null because of
... != ...
.
Condition is always null because of
... != ...
.
return $"({propertyLease.Name})";
}

if (property?.Location != null)

Check warning

Code scanning / CodeQL

Constant condition Warning

Condition is always false because of
... != ...
.
Condition is always false because of
... != ...
.
return $"({propertyLease.Name})";
}

if (property?.Location != null)

Check warning

Code scanning / CodeQL

Constant condition Warning

Condition is always null because of
... != ...
.
Condition is always null because of
... != ...
.
@sonarqubecloud
Copy link
Copy Markdown

Merged via the queue into bcgov:dev with commit 04fb546 Feb 21, 2026
18 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

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

@asanchezr asanchezr deleted the psp-10920-contractor-access-exports branch February 26, 2026 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants