fixes #3007: Eliminate Janitor role
This commit is contained in:
@@ -17,8 +17,8 @@ class Artist < ActiveRecord::Base
|
||||
has_one :wiki_page, :foreign_key => "title", :primary_key => "name"
|
||||
has_one :tag_alias, :foreign_key => "antecedent_name", :primary_key => "name"
|
||||
has_one :tag, :foreign_key => "name", :primary_key => "name"
|
||||
attr_accessible :body, :notes, :name, :url_string, :other_names, :other_names_comma, :group_name, :notes, :as => [:member, :gold, :builder, :platinum, :janitor, :moderator, :default, :admin]
|
||||
attr_accessible :is_active, :as => [:builder, :janitor, :moderator, :default, :admin]
|
||||
attr_accessible :body, :notes, :name, :url_string, :other_names, :other_names_comma, :group_name, :notes, :as => [:member, :gold, :builder, :platinum, :moderator, :default, :admin]
|
||||
attr_accessible :is_active, :as => [:builder, :moderator, :default, :admin]
|
||||
attr_accessible :is_banned, :as => :admin
|
||||
|
||||
scope :active, lambda { where(is_active: true) }
|
||||
|
||||
@@ -18,7 +18,7 @@ class Comment < ActiveRecord::Base
|
||||
after_update(:if => lambda {|rec| rec.is_deleted? && rec.is_deleted_changed? && CurrentUser.id != rec.creator_id}) do |rec|
|
||||
ModAction.log("comment ##{rec.id} deleted by #{CurrentUser.name}")
|
||||
end
|
||||
attr_accessible :body, :post_id, :do_not_bump_post, :is_deleted, :as => [:member, :gold, :platinum, :builder, :janitor, :moderator, :admin]
|
||||
attr_accessible :body, :post_id, :do_not_bump_post, :is_deleted, :as => [:member, :gold, :platinum, :builder, :moderator, :admin]
|
||||
attr_accessible :is_sticky, :as => [:moderator, :admin]
|
||||
mentionable(
|
||||
:message_field => :body,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class DmailFilter < ActiveRecord::Base
|
||||
belongs_to :user
|
||||
attr_accessible :words, :as => [:moderator, :janitor, :gold, :platinum, :member, :anonymous, :default, :builder, :admin]
|
||||
attr_accessible :words, :as => [:moderator, :gold, :platinum, :member, :anonymous, :default, :builder, :admin]
|
||||
validates_presence_of :user
|
||||
before_validation :initialize_user
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class FavoriteGroup < ActiveRecord::Base
|
||||
validate :creator_can_create_favorite_groups, :on => :create
|
||||
validate :validate_number_of_posts
|
||||
before_save :update_post_count
|
||||
attr_accessible :name, :post_ids, :post_id_array, :as => [:member, :gold, :platinum, :builder, :janitor, :moderator, :admin, :default]
|
||||
attr_accessible :name, :post_ids, :post_id_array, :as => [:member, :gold, :platinum, :builder, :moderator, :admin, :default]
|
||||
|
||||
module SearchMethods
|
||||
def for_creator(user_id)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class ForumPost < ActiveRecord::Base
|
||||
include Mentionable
|
||||
|
||||
attr_accessible :body, :topic_id, :as => [:member, :builder, :janitor, :gold, :platinum, :admin, :moderator, :default]
|
||||
attr_accessible :body, :topic_id, :as => [:member, :builder, :gold, :platinum, :admin, :moderator, :default]
|
||||
attr_accessible :is_locked, :is_sticky, :is_deleted, :as => [:admin, :moderator]
|
||||
attr_readonly :topic_id
|
||||
belongs_to :creator, :class_name => "User"
|
||||
|
||||
@@ -11,7 +11,7 @@ class ForumTopic < ActiveRecord::Base
|
||||
Admin: User::Levels::ADMIN,
|
||||
}
|
||||
|
||||
attr_accessible :title, :original_post_attributes, :category_id, :as => [:member, :builder, :gold, :platinum, :janitor, :moderator, :admin, :default]
|
||||
attr_accessible :title, :original_post_attributes, :category_id, :as => [:member, :builder, :gold, :platinum, :moderator, :admin, :default]
|
||||
attr_accessible :is_sticky, :is_locked, :is_deleted, :min_level, :as => [:admin, :moderator]
|
||||
belongs_to :creator, :class_name => "User"
|
||||
belongs_to :updater, :class_name => "User"
|
||||
|
||||
@@ -20,7 +20,7 @@ class Pool < ActiveRecord::Base
|
||||
after_save :create_version
|
||||
after_create :synchronize!
|
||||
before_destroy :create_mod_action_for_destroy
|
||||
attr_accessible :name, :description, :post_ids, :post_id_array, :post_count, :is_active, :category, :as => [:member, :gold, :platinum, :janitor, :moderator, :admin, :default]
|
||||
attr_accessible :name, :description, :post_ids, :post_id_array, :post_count, :is_active, :category, :as => [:member, :gold, :platinum, :moderator, :admin, :default]
|
||||
attr_accessible :is_deleted, :as => [:moderator, :admin]
|
||||
|
||||
module SearchMethods
|
||||
|
||||
@@ -54,8 +54,8 @@ class Post < ActiveRecord::Base
|
||||
has_many :versions, lambda {order("post_versions.updated_at ASC")}, :class_name => "PostArchive", :dependent => :destroy
|
||||
end
|
||||
|
||||
attr_accessible :source, :rating, :tag_string, :old_tag_string, :old_parent_id, :old_source, :old_rating, :parent_id, :has_embedded_notes, :as => [:member, :builder, :gold, :platinum, :janitor, :moderator, :admin, :default]
|
||||
attr_accessible :is_rating_locked, :is_note_locked, :as => [:builder, :janitor, :moderator, :admin]
|
||||
attr_accessible :source, :rating, :tag_string, :old_tag_string, :old_parent_id, :old_source, :old_rating, :parent_id, :has_embedded_notes, :as => [:member, :builder, :gold, :platinum, :moderator, :admin, :default]
|
||||
attr_accessible :is_rating_locked, :is_note_locked, :as => [:builder, :moderator, :admin]
|
||||
attr_accessible :is_status_locked, :as => [:admin]
|
||||
attr_accessor :old_tag_string, :old_parent_id, :old_source, :old_rating, :has_constraints, :disable_versioning, :view_count
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ class Tag < ActiveRecord::Base
|
||||
COSINE_SIMILARITY_RELATED_TAG_THRESHOLD = 1000
|
||||
METATAGS = "-user|user|-approver|approver|commenter|comm|noter|noteupdater|artcomm|-pool|pool|ordpool|-favgroup|favgroup|-fav|fav|ordfav|sub|md5|-rating|rating|-locked|locked|width|height|mpixels|ratio|score|favcount|filesize|source|-source|id|-id|date|age|order|limit|-status|status|tagcount|gentags|arttags|chartags|copytags|parent|-parent|child|pixiv_id|pixiv|search|upvote|downvote|filetype|-filetype"
|
||||
SUBQUERY_METATAGS = "commenter|comm|noter|noteupdater|artcomm"
|
||||
attr_accessible :category, :as => [:moderator, :janitor, :gold, :platinum, :member, :anonymous, :default, :builder, :admin]
|
||||
attr_accessible :category, :as => [:moderator, :gold, :platinum, :member, :anonymous, :default, :builder, :admin]
|
||||
attr_accessible :is_locked, :as => [:moderator, :admin]
|
||||
has_one :wiki_page, :foreign_key => "title", :primary_key => "name"
|
||||
has_one :antecedent_alias, lambda {active}, :class_name => "TagAlias", :foreign_key => "antecedent_name", :primary_key => "name"
|
||||
|
||||
@@ -11,7 +11,6 @@ class User < ActiveRecord::Base
|
||||
GOLD = 30
|
||||
PLATINUM = 31
|
||||
BUILDER = 32
|
||||
JANITOR = 35
|
||||
MODERATOR = 40
|
||||
ADMIN = 50
|
||||
end
|
||||
@@ -52,7 +51,7 @@ class User < ActiveRecord::Base
|
||||
has_bit_flags BOOLEAN_ATTRIBUTES, :field => "bit_prefs"
|
||||
|
||||
attr_accessor :password, :old_password
|
||||
attr_accessible :dmail_filter_attributes, :enable_privacy_mode, :enable_post_navigation, :new_post_navigation_layout, :password, :old_password, :password_confirmation, :password_hash, :email, :last_logged_in_at, :last_forum_read_at, :has_mail, :receive_email_notifications, :comment_threshold, :always_resize_images, :favorite_tags, :blacklisted_tags, :name, :ip_addr, :time_zone, :default_image_size, :enable_sequential_post_navigation, :per_page, :hide_deleted_posts, :style_usernames, :enable_auto_complete, :custom_style, :show_deleted_children, :disable_categorized_saved_searches, :disable_tagged_filenames, :enable_recent_searches, :as => [:moderator, :janitor, :gold, :platinum, :member, :anonymous, :default, :builder, :admin]
|
||||
attr_accessible :dmail_filter_attributes, :enable_privacy_mode, :enable_post_navigation, :new_post_navigation_layout, :password, :old_password, :password_confirmation, :password_hash, :email, :last_logged_in_at, :last_forum_read_at, :has_mail, :receive_email_notifications, :comment_threshold, :always_resize_images, :favorite_tags, :blacklisted_tags, :name, :ip_addr, :time_zone, :default_image_size, :enable_sequential_post_navigation, :per_page, :hide_deleted_posts, :style_usernames, :enable_auto_complete, :custom_style, :show_deleted_children, :disable_categorized_saved_searches, :disable_tagged_filenames, :enable_recent_searches, :as => [:moderator, :gold, :platinum, :member, :anonymous, :default, :builder, :admin]
|
||||
attr_accessible :level, :as => :admin
|
||||
|
||||
validates :name, user_name: true, on: :create
|
||||
@@ -313,7 +312,6 @@ class User < ActiveRecord::Base
|
||||
"Gold" => Levels::GOLD,
|
||||
"Platinum" => Levels::PLATINUM,
|
||||
"Builder" => Levels::BUILDER,
|
||||
"Janitor" => Levels::JANITOR,
|
||||
"Moderator" => Levels::MODERATOR,
|
||||
"Admin" => Levels::ADMIN
|
||||
}
|
||||
@@ -336,9 +334,6 @@ class User < ActiveRecord::Base
|
||||
when Levels::PLATINUM
|
||||
"Platinum"
|
||||
|
||||
when Levels::JANITOR
|
||||
"Janitor"
|
||||
|
||||
when Levels::MODERATOR
|
||||
"Moderator"
|
||||
|
||||
@@ -408,10 +403,6 @@ class User < ActiveRecord::Base
|
||||
level >= Levels::PLATINUM
|
||||
end
|
||||
|
||||
def is_janitor?
|
||||
level >= Levels::JANITOR
|
||||
end
|
||||
|
||||
def is_moderator?
|
||||
level >= Levels::MODERATOR
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user