GitLab wurde erfolgreich aktualisiert. Dank regelmäßiger Updates bleibt das THM GitLab sicher und Sie profitieren von den neuesten Funktionen. Danke für Ihre Geduld.

Commit 0cd0ea3f authored by Daniel Gerhardt's avatar Daniel Gerhardt Committed by Tom Käsler

Add CAS specifc methods to user model

parent 59dead44
......@@ -866,11 +866,11 @@ def allow_password_authentication?
end
def allow_password_authentication_for_web?
Gitlab::CurrentSettings.password_authentication_enabled_for_web? && !ldap_user? && !ultraauth_user?
Gitlab::CurrentSettings.password_authentication_enabled_for_web? && !ldap_user? && !cas_user? && !ultraauth_user?
end
def allow_password_authentication_for_git?
Gitlab::CurrentSettings.password_authentication_enabled_for_git? && !ldap_user? && !ultraauth_user?
Gitlab::CurrentSettings.password_authentication_enabled_for_git? && !ldap_user? && !cas_user? && !ultraauth_user?
end
def can_change_username?
......@@ -962,6 +962,14 @@ def ldap_identity
@ldap_identity ||= identities.find_by(["provider LIKE ?", "ldap%"])
end
def cas_user?
identities.exists?(["provider = ? AND extern_uid IS NOT NULL", "cas3"])
end
def cas_identity
@cas_identity ||= identities.find_by(["provider = ?", "cas3"])
end
def project_deploy_keys
DeployKey.in_projects(authorized_projects.select(:id)).distinct(:id)
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment