Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[candidate_profile] Show Consent Summary card iff useConsent Yes #6807

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
);
}

}