Skip to content

Commit

Permalink
[candidate_profile] Show Consent Summary card iff useConsent Yes (ace…
Browse files Browse the repository at this point in the history
  • Loading branch information
zaliqarosli authored and AlexandraLivadas committed Jun 15, 2021
1 parent cf46b3a commit eb95b28
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/candidate_parameters/php/module.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ class Module extends \Module
return [];
}

if (!\NDB_Factory::singleton()->settings()->consentEnabled()) {
return [];
}

// The candidate getConsents only returns the types of
// consents that the candidate has saved, we want to
// summarize all of the types configured in the database.
Expand Down
12 changes: 12 additions & 0 deletions php/libraries/Settings.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -164,5 +164,17 @@ class Settings
return false;
}

/**
* Determines whether the useConsent configuration setting is
* enabled
*
* @return bool True if the useConsent setting is enabled
*/
function consentEnabled(): bool
{
return \NDB_Factory::singleton()->config()->settingEnabled(
'useConsent'
);
}

}

0 comments on commit eb95b28

Please # to comment.