All permission checks fail when permissions lack displayNames
Description
The code in the UI that checks permissions starts out by fetching the perms from the server, and making a map that records which permission names are provided. Previously, it mapped permission names to the corresponding human-readable display names. This worked fine for testing whether a user has a permission by seeing whether the map has the relevant entry. But when the displayName is undefined, as it is in the mod-users test data (as opposed to the auth-blackbox VM), this fails – permissions are present, but undefined.
CSP Request Details
None
CSP Rejection Details
None
Potential Workaround
None
Checklist
hide
TestRail: Results
Activity
Show:
Mike Taylor April 4, 2017 at 8:23 AM
Since the permission-checking never actually uses the displayName (only its presence), we now fix this by simply mapping from permission name to the constant `true`.
The code in the UI that checks permissions starts out by fetching the perms from the server, and making a map that records which permission names are provided. Previously, it mapped permission names to the corresponding human-readable display names. This worked fine for
testing whether a user has a permission by seeing whether the map has the relevant entry. But when the displayName is undefined, as it is in the mod-users test data (as opposed to the auth-blackbox VM), this fails – permissions are present, but undefined.