diff options
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index bc113c72762..d44e8162abe 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1527,6 +1527,13 @@ class User < ApplicationRecord end def read_only_attribute?(attribute) + if Feature.enabled?(:ldap_readonly_attributes, default_enabled: true) + enabled = Gitlab::Auth::LDAP::Config.enabled? + read_only = attribute.to_sym.in?(UserSyncedAttributesMetadata::SYNCABLE_ATTRIBUTES) + + return true if enabled && read_only + end + user_synced_attributes_metadata&.read_only?(attribute) end |