mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 09:10:25 +08:00
FEATURE: invite existing users to private topic
This commit is contained in:
parent
627bd08477
commit
d491d4f997
9 changed files with 74 additions and 21 deletions
|
@ -214,14 +214,12 @@ class Guardian
|
|||
return false unless ( SiteSetting.enable_local_logins && (!SiteSetting.must_approve_users? || is_staff?) )
|
||||
return true if is_admin?
|
||||
return false if ! can_see?(object)
|
||||
|
||||
return false if group_ids.present?
|
||||
|
||||
if object.is_a?(Topic) && object.category
|
||||
if object.category.groups.any?
|
||||
return true if object.category.groups.all? { |g| can_edit_group?(g) }
|
||||
end
|
||||
return false if object.category.read_restricted
|
||||
end
|
||||
|
||||
user.has_trust_level?(TrustLevel[2])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue