You are here

function openid_connect_set_password_access in OpenID Connect / OAuth client 7

Same name and namespace in other branches
  1. 8 openid_connect.module \openid_connect_set_password_access()

Find whether the user is allowed to change their own password.

Parameters

object $account: A user account object.

Return value

bool TRUE if access is granted, FALSE otherwise.

1 call to openid_connect_set_password_access()
openid_connect_form_user_profile_form_alter in ./openid_connect.module
Implements hook_form_FORM_ID_alter().

File

./openid_connect.module, line 493
A pluggable client implementation for the OpenID Connect protocol.

Code

function openid_connect_set_password_access($account) {
  if (user_access('openid_connect set own password', $account)) {
    return TRUE;
  }
  $connected_accounts = openid_connect_get_connected_accounts($account);
  return empty($connected_accounts);
}