mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
FEATURE: support inviting existing users to topic and message when SSO is enabled
This commit is contained in:
parent
7d5b8de1f8
commit
e8dd5592c6
6 changed files with 30 additions and 18 deletions
|
@ -197,12 +197,6 @@ class Guardian
|
|||
is_me?(user)
|
||||
end
|
||||
|
||||
def invitations_allowed?
|
||||
!SiteSetting.enable_sso &&
|
||||
SiteSetting.enable_local_logins &&
|
||||
(!SiteSetting.must_approve_users? || is_staff?)
|
||||
end
|
||||
|
||||
def can_invite_to_forum?(groups=nil)
|
||||
authenticated? &&
|
||||
!SiteSetting.enable_sso &&
|
||||
|
@ -216,7 +210,7 @@ class Guardian
|
|||
|
||||
def can_invite_to?(object, group_ids=nil)
|
||||
return false if ! authenticated?
|
||||
return false if ! invitations_allowed?
|
||||
return false unless ( SiteSetting.enable_local_logins && (!SiteSetting.must_approve_users? || is_staff?) )
|
||||
return true if is_admin?
|
||||
return false if ! can_see?(object)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue