mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-16 21:24:05 +00:00
Implement role authorization
This commit is contained in:
parent
6755328c4c
commit
e2fb434dc7
122 changed files with 1386 additions and 751 deletions
|
|
@ -1,8 +1,10 @@
|
|||
module Admin
|
||||
class CallforpapersController < ApplicationController
|
||||
before_filter :verify_organizer
|
||||
load_and_authorize_resource :conference, find_by: :short_title
|
||||
# load_and_authorize_resource :cfp, class: 'CallForPapers', through: :conference
|
||||
|
||||
def show
|
||||
authorize! :show, CallForPapers.new(conference_id: @conference.id)
|
||||
@cfp = @conference.call_for_papers
|
||||
if @cfp.nil?
|
||||
@cfp = CallForPapers.new
|
||||
|
|
@ -10,6 +12,7 @@ module Admin
|
|||
end
|
||||
|
||||
def update
|
||||
authorize! :update, @conference.call_for_papers
|
||||
@cfp = @conference.call_for_papers
|
||||
@cfp.assign_attributes(params[:call_for_papers])
|
||||
send_mail_on_schedule_public = @cfp.notify_on_schedule_public?
|
||||
|
|
@ -30,6 +33,7 @@ module Admin
|
|||
end
|
||||
|
||||
def create
|
||||
authorize! :update, CallForPapers.new(conference_id: @conference.id)
|
||||
@cfp = CallForPapers.new(params[:call_for_papers])
|
||||
if @cfp.valid?
|
||||
@cfp.save
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue