Skip to content

Commit

Permalink
[candidate_profile] Show Consent Summary card iff useConsent Yes (#6807)
Browse files Browse the repository at this point in the history
Resolves #6680
  • Loading branch information
zaliqarosli committed Jul 13, 2020
1 parent 382f308 commit 28d4a14
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 28d4a14

Please # to comment.