Skip to content

Commit aa52c56

Browse files
jiffBalazs Dianiska
authored andcommitted
Issue #2429931 by DMaester, jiff: Tie the user setting that enables SSO authentication to permission
1 parent 232b1a5 commit aa52c56

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

simplesamlphp_auth.module

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ function simplesamlphp_auth_permission() {
103103
'title' => t('Administer simpleSAMLphp authentication'),
104104
'restrict access' => TRUE,
105105
),
106+
'change saml authentication setting' => array(
107+
'title' => t('Change SAML authentication setting for individual accounts'),
108+
'description' => t('Allow users to enable or disable SAML authentication per user on user edit forms.'),
109+
'restrict access' => TRUE,
110+
),
106111
);
107112
}
108113

@@ -282,7 +287,7 @@ function simplesamlphp_auth_form_alter(&$form, $form_state, $form_id) {
282287
$form['links']['#markup'] = $link;
283288
}
284289

285-
if ($form_id == 'user_register_form' || $form_id == 'user_profile_form') {
290+
if (($form_id == 'user_register_form' || $form_id == 'user_profile_form') && user_access('change saml authentication setting')) {
286291
$form['saml'] = array(
287292
'#type' => 'checkbox',
288293
'#title' => t('Enable this user to leverage SAML authentication'),

0 commit comments

Comments
 (0)