Skip to content

Commit

Permalink
filtering on idp/Hint vs code
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Sherman <[email protected]>
  • Loading branch information
usingtechnology committed Feb 28, 2024
1 parent 7242d58 commit b70f8de
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
8 changes: 6 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@
"editor.formatOnSave": true
}
}
}
},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
//"remoteUser": "root"
//"remoteUser": "root",

"containerEnv": {
"NODE_CONFIG_DIR": "${containerWorkspaceFolder}/.devcontainer/chefs_local"
}
}
1 change: 1 addition & 0 deletions .devcontainer/post-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ WORKSPACE_DIR=$(pwd)
CHEFS_LOCAL_DIR=${WORKSPACE_DIR}/.devcontainer/chefs_local

npm install knex -g
npm install jest -g

# install app libraries, prepare for app development and debugging...
cd app
Expand Down
4 changes: 2 additions & 2 deletions app/src/forms/auth/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const service = {
let forms = [];
let filtered = items.filter((x) => {
// include if user has idp, or form is public, or user has an explicit role.
if (x.idps.includes(userInfo.idp) || x.idps.includes('public')) {
if (x.idps.includes(userInfo.idpHint) || x.idps.includes('public')) {
// always give submitter permissions to launch by idp and public
x.permissions = Array.from(new Set([...x.permissions, ...FORM_SUBMITTER]));
return true;
Expand All @@ -132,7 +132,7 @@ const service = {
hasPublic = item.idps.includes('public');
} else if (accessLevels.includes('idp')) {
// must have user's idp in idps...
hasIdp = item.idps.includes(userInfo.idp);
hasIdp = item.idps.includes(userInfo.idpHint);
} else if (accessLevels.includes('team')) {
// must have a role...
hasTeam = item.roles.length;
Expand Down
2 changes: 1 addition & 1 deletion app/src/forms/form/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ const service = {
.withGraphFetched('idpHints')
.throwIfNotFound()
.then((form) => {
form.idpHints = form.idpHints.map((idp) => idp.code);
form.idpHints = form.idpHints.map((idp) => idp.idp);
return form;
});
},
Expand Down

0 comments on commit b70f8de

Please sign in to comment.