mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
more group progress, UI getting there, controller mostly done
changed it so notify moderators goes to the moderators group allow admins to grant self moderation and revoke self moderation
This commit is contained in:
@@ -141,15 +141,16 @@ class Guardian
|
||||
def can_revoke_moderation?(moderator)
|
||||
return false unless is_admin?
|
||||
return false if moderator.blank?
|
||||
return false if @user.id == moderator.id
|
||||
return false if @user.id == moderator.id && !is_admin?
|
||||
return false unless moderator.moderator?
|
||||
true
|
||||
end
|
||||
|
||||
def can_grant_moderation?(user)
|
||||
return false unless is_admin?
|
||||
return false if user.blank?
|
||||
return false if @user.id == user.id
|
||||
return false if user.staff?
|
||||
return false unless is_admin?
|
||||
return false unless user
|
||||
return false if @user.id == user.id && !is_admin?
|
||||
return false if user.moderator?
|
||||
true
|
||||
end
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ class PostCreator
|
||||
# archetype - Topic archetype
|
||||
# category - Category to assign to topic
|
||||
# target_usernames - comma delimited list of usernames for membership (private message)
|
||||
# target_group_names - comma delimited list of groups for membership (private message)
|
||||
# meta_data - Topic meta data hash
|
||||
def initialize(user, opts)
|
||||
# TODO: we should reload user in case it is tainted, should take in a user_id as opposed to user
|
||||
|
||||
Reference in New Issue
Block a user