Skip to content

Commit

Permalink
Merge branch 'main' into feature/forms-779-devcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterMoar authored Jan 18, 2024
2 parents 192f335 + 50cd70a commit 4ac665d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/src/forms/rbac/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const controller = require('./controller');
const keycloak = require('../../components/keycloak');
const P = require('../common/constants').Permissions;
const R = require('../common/constants').Roles;
const { currentUser, hasFormPermissions, hasSubmissionPermissions, hasFormRoles, hasRolePermissions } = require('../auth/middleware/userAccess');
const { currentUserTemp, hasFormPermissions, hasSubmissionPermissions, hasFormRoles, hasRolePermissions } = require('../auth/middleware/userAccess');

routes.use(currentUser);
routes.use(currentUserTemp);

routes.get('/current', keycloak.protect(), async (req, res, next) => {
await controller.getCurrentUser(req, res, next);
Expand Down
5 changes: 4 additions & 1 deletion app/src/forms/rbac/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,11 @@ const service = {
if (params.idp) accessLevels.push('idp');
if (params.team) accessLevels.push('team');
}
const filteredForms = authService.filterForms(user, user.forms, accessLevels);

const forms = await authService.getUserForms(user, { ...params, active: true });
const filteredForms = authService.filterForms(user, forms, accessLevels);
user.forms = filteredForms;

return user;
},

Expand Down

0 comments on commit 4ac665d

Please sign in to comment.