Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OLMIS-7992: Fix passing parameter to hasRoleWithRightForProgramAndSupervisoryNode function #53

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
7.0.13-SNAPSHOT / WIP
==================

Bug fixes:
* [OLMIS-7992](https://openlmis.atlassian.net/browse/OLMIS-7992): Fix passing parameter to hasRoleWithRightForProgramAndSupervisoryNode function

7.0.12 / 2024-04-19
==================

New functionalities that are backwards-compatible:
* [OLMIS-7838](https://openlmis.atlassian.net/browse/OLMIS-7838): Move BUQ and TM Monthly functionalities from Tanzania to Core instance

Expand Down
3 changes: 1 addition & 2 deletions src/requisition/requisition-cache.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,7 @@
function hasRightForRequisition(requisition) {
return permissionService.hasRoleWithRightForProgramAndSupervisoryNode(
REQUISITION_RIGHTS.REQUISITION_VIEW,
requisition.program.id,
requisition.supervisoryNode
requisition
);
}

Expand Down
10 changes: 4 additions & 6 deletions src/requisition/requisition-cache.service.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,9 @@ describe('requisitionCacheService', function() {
});

this.permissionService.hasRoleWithRightForProgramAndSupervisoryNode
.andCallFake(function(right, program, supervisoryNode) {
.andCallFake(function(right, requisition) {
return context.$q.resolve(!(right === context.REQUISITION_RIGHTS.REQUISITION_VIEW
&& program === context.batchRequisitionOne.program.id
&& supervisoryNode === context.batchRequisitionOne.supervisoryNode));
&& requisition === context.batchRequisitionOne));
});

var result;
Expand Down Expand Up @@ -352,10 +351,9 @@ describe('requisitionCacheService', function() {
it('should return requisition if user has not related right but has permission string', function() {
var context = this;
this.permissionService.hasRoleWithRightForProgramAndSupervisoryNode
.andCallFake(function(right, program, supervisoryNode) {
.andCallFake(function(right, requisition) {
return !(right === context.REQUISITION_RIGHTS.REQUISITION_VIEW &&
program === context.batchRequisitionOne.program.id &&
supervisoryNode === context.batchRequisitionOne.supervisoryNode);
requisition === context.batchRequisitionOne);
});

var result;
Expand Down
Loading