This commit is contained in:
r888888888
2014-04-17 14:17:11 -07:00
parent fad0ab7c93
commit 90f3156a73
5 changed files with 27 additions and 9 deletions

View File

@@ -203,4 +203,8 @@ class WikiPage < ActiveRecord::Base
def create_mod_action_for_destroy
ModAction.create(:description => "permanently deleted wiki page [[#{title}]]")
end
def visible?
artist.blank? || !artist.is_banned? || CurrentUser.user.is_janitor?
end
end

View File

@@ -1,6 +1,7 @@
class WikiPageVersion < ActiveRecord::Base
belongs_to :wiki_page
belongs_to :updater, :class_name => "User"
belongs_to :artist
attr_accessible :wiki_page_id, :title, :body, :is_locked, :updater_id, :updater_ip_addr, :version
module SearchMethods
@@ -37,4 +38,9 @@ class WikiPageVersion < ActiveRecord::Base
def category_name
Tag.category_for(title)
end
def visible?
artist.blank? || !artist.is_banned? || CurrentUser.user.is_janitor?
end
end