feat: move saml methods to enterprise
This commit is contained in:
+5
-4
@@ -152,17 +152,18 @@ class User < ApplicationRecord
|
||||
mutations_from_database.changed?('email')
|
||||
end
|
||||
|
||||
# SAML authentication methods
|
||||
# SAML methods - fallback implementations for Community Edition
|
||||
# These will be overridden in Enterprise Edition via include_mod_with
|
||||
def saml_user?
|
||||
provider == 'saml'
|
||||
false
|
||||
end
|
||||
|
||||
def convert_to_saml!
|
||||
update!(provider: 'saml')
|
||||
# No-op in Community Edition
|
||||
end
|
||||
|
||||
def password_authentication_allowed?
|
||||
!saml_user?
|
||||
true
|
||||
end
|
||||
|
||||
def self.from_email(email)
|
||||
|
||||
@@ -13,4 +13,17 @@ module Enterprise::Concerns::User
|
||||
|
||||
errors.add(:base, 'User limit reached. Please purchase more licenses from super admin') if User.count >= ChatwootHub.pricing_plan_quantity
|
||||
end
|
||||
|
||||
# SAML authentication methods (Enterprise only)
|
||||
def saml_user?
|
||||
provider == 'saml'
|
||||
end
|
||||
|
||||
def convert_to_saml!
|
||||
update!(provider: 'saml')
|
||||
end
|
||||
|
||||
def password_authentication_allowed?
|
||||
!saml_user?
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user