2014-03-23 00:22:25 +00:00
|
|
|
class ForumersController < ApplicationController
|
|
|
|
def create
|
2020-03-18 03:38:17 +00:00
|
|
|
@forumer = Forumer.new(Forumer.params(params, cuser))
|
2014-03-23 00:22:25 +00:00
|
|
|
raise AccessError unless @forumer.can_create? cuser
|
|
|
|
|
|
|
|
if @forumer.save
|
|
|
|
flash[:notice] = t(:groups_added)
|
|
|
|
else
|
|
|
|
flash[:error] = @forumer.errors.full_messages.to_s
|
|
|
|
end
|
|
|
|
|
|
|
|
redirect_to_back
|
|
|
|
end
|
|
|
|
|
|
|
|
def update
|
|
|
|
@forumer = Forumer.find params[:id]
|
|
|
|
raise AccessError unless @forumer.can_update? cuser
|
|
|
|
|
2020-03-18 03:38:17 +00:00
|
|
|
if @forumer.update_attributes(Forumer.params(params, cuser))
|
2014-03-23 00:22:25 +00:00
|
|
|
flash[:notice] = t(:groups_acl_update)
|
|
|
|
else
|
|
|
|
flash[:error] = @forumer.errors.full_messages.to_s
|
|
|
|
end
|
|
|
|
|
|
|
|
redirect_to_back
|
|
|
|
end
|
|
|
|
|
|
|
|
def destroy
|
|
|
|
@forumer = Forumer.find params[:id]
|
|
|
|
raise AccessError unless @forumer.can_destroy? cuser
|
|
|
|
|
|
|
|
@forumer.destroy
|
|
|
|
redirect_to_back
|
|
|
|
end
|
|
|
|
end
|