Skip to content

Commit

Permalink
Fixing confidential fields computation.
Browse files Browse the repository at this point in the history
Forgot something @naholyr ? :)
Refs #222
  • Loading branch information
Yomguithereal committed Jan 12, 2017
1 parent 2a14c27 commit 1a4fce7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/lib/permissions.js
Expand Up @@ -443,6 +443,7 @@ const canViewConfidentialFields = (req) => Promise.resolve(
)

const computeRestrictedFieldsLong = (modelName, userCentralRole, userRoles, organizationId) => {

// Central admin → no restriction
if (userCentralRole === 'admin') {
return Promise.resolve({
Expand Down Expand Up @@ -470,7 +471,7 @@ const computeRestrictedFieldsLong = (modelName, userCentralRole, userRoles, orga
})
}

const computeRestrictedFieldsShort = (modelName, req) => computeRestrictedFieldsLong(modelName, req.userRoles, req.userScopeOrganizationId)
const computeRestrictedFieldsShort = (modelName, req) => computeRestrictedFieldsLong(modelName, req.userCentralRole, req.userRoles, req.userScopeOrganizationId)

exports.computeRestrictedFields = (modelName, userCentralRoleOrReq, userRoles = undefined, organizationId = undefined) => {
if (userRoles !== undefined && organizationId !== undefined) {
Expand Down

1 comment on commit 1a4fce7

@naholyr
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bien vu, a priori rien de plus non

Please sign in to comment.