mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 01:16:38 -06:00
Disabled editing of SSO overridden fields
This commit is contained in:
parent
4efabef8f2
commit
23d7b17f1a
@ -6,12 +6,14 @@ module UserGuardian
|
||||
end
|
||||
|
||||
def can_edit_username?(user)
|
||||
return false if (SiteSetting.sso_overrides_username? && SiteSetting.enable_sso?)
|
||||
return true if is_staff?
|
||||
return false if SiteSetting.username_change_period <= 0
|
||||
is_me?(user) && (user.post_count == 0 || user.created_at > SiteSetting.username_change_period.days.ago)
|
||||
end
|
||||
|
||||
def can_edit_email?(user)
|
||||
return false if (SiteSetting.sso_overrides_email? && SiteSetting.enable_sso?)
|
||||
return true if is_staff?
|
||||
return false unless SiteSetting.email_editable?
|
||||
can_edit?(user)
|
||||
|
Loading…
Reference in New Issue
Block a user