* Removed unapprovals, added post flags and post appeals (still need to update tests)
* Restyled text
This commit is contained in:
25
app/controllers/post_flags_controller.rb
Normal file
25
app/controllers/post_flags_controller.rb
Normal file
@@ -0,0 +1,25 @@
|
||||
class PostFlagsController < ApplicationController
|
||||
before_filter :member_only
|
||||
respond_to :html, :xml, :json, :js
|
||||
rescue_from User::PrivilegeError, :with => "static/access_denied"
|
||||
|
||||
def new
|
||||
@post_flag = PostFlag.new
|
||||
respond_with(@post_flag)
|
||||
end
|
||||
|
||||
def index
|
||||
@search = PostFlag.search(params[:search])
|
||||
@post_flags = @search.paginate(:page => params[:page])
|
||||
end
|
||||
|
||||
def create
|
||||
@post_flag = PostFlag.create(params[:post_flag])
|
||||
respond_with(@post_flag)
|
||||
end
|
||||
|
||||
private
|
||||
def check_privilege(post_flag)
|
||||
raise User::PrivilegeError unless (post_flag.creator_id == CurrentUser.id || CurrentUser.is_moderator?)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user