Skip to content

Commit

Permalink
Merge pull request #293 from dinukadesilva/gh-284
Browse files Browse the repository at this point in the history
Adding the area names to the root token
  • Loading branch information
dinukadesilva authored Nov 2, 2019
2 parents 72a1c7e + 3a35dfa commit 2ecc023
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions orm/entities/Election/election_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,36 @@ def get_root_token(electionId):
],
SUB: "[email protected]", AREA_CLAIM_PREFIX + ADMIN_ROLE: str([]),
AREA_CLAIM_PREFIX + DATA_EDITOR_ROLE: str([{
"areaId": electoral_district.areaId
"areaId": electoral_district.areaId,
"areaName": electoral_district.areaName
} for electoral_district in electoral_districts]),
AREA_CLAIM_PREFIX + POLLING_DIVISION_REPORT_VIEWER_ROLE: str([{
"areaId": electoral_district.areaId
"areaId": electoral_district.areaId,
"areaName": electoral_district.areaName
} for electoral_district in electoral_districts]),
AREA_CLAIM_PREFIX + POLLING_DIVISION_REPORT_VERIFIER_ROLE: str([{
"areaId": electoral_district.areaId
"areaId": electoral_district.areaId,
"areaName": electoral_district.areaName
} for electoral_district in electoral_districts]),
AREA_CLAIM_PREFIX + ELECTORAL_DISTRICT_REPORT_VIEWER_ROLE: str([{
"areaId": electoral_district.areaId
"areaId": electoral_district.areaId,
"areaName": electoral_district.areaName
} for electoral_district in electoral_districts]),
AREA_CLAIM_PREFIX + ELECTORAL_DISTRICT_REPORT_VERIFIER_ROLE: str([{
"areaId": electoral_district.areaId
"areaId": electoral_district.areaId,
"areaName": electoral_district.areaName
} for electoral_district in electoral_districts]),
AREA_CLAIM_PREFIX + NATIONAL_REPORT_VIEWER_ROLE: str([{
"areaId": country.areaId
"areaId": country.areaId,
"areaName": country.areaName
} for country in countries]),
AREA_CLAIM_PREFIX + NATIONAL_REPORT_VERIFIER_ROLE: str([{
"areaId": country.areaId
"areaId": country.areaId,
"areaName": country.areaName
} for country in countries]),
AREA_CLAIM_PREFIX + EC_LEADERSHIP_ROLE: str([{
"areaId": country.areaId
"areaId": country.areaId,
"areaName": country.areaName
} for country in countries])
}

Expand Down

0 comments on commit 2ecc023

Please sign in to comment.