mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-16 13:14:03 +00:00
Implement role authorization
This commit is contained in:
parent
6755328c4c
commit
e2fb434dc7
122 changed files with 1386 additions and 751 deletions
|
|
@ -1,10 +1,14 @@
|
|||
module Admin
|
||||
class SchedulesController < ApplicationController
|
||||
before_filter :verify_organizer
|
||||
# By authorizing 'conference' resource, we can ensure there will be no unauthorized access to
|
||||
# the schedule of a conference, which should not be accessed in the first place
|
||||
load_and_authorize_resource :conference, find_by: :short_title
|
||||
|
||||
skip_before_filter :verify_authenticity_token, only: [:update]
|
||||
layout 'schedule'
|
||||
|
||||
def show
|
||||
authorize! :update, @conference.events.new
|
||||
if @conference.nil?
|
||||
redirect_to admin_conference_index_path
|
||||
return
|
||||
|
|
@ -14,6 +18,7 @@ module Admin
|
|||
end
|
||||
|
||||
def update
|
||||
authorize! :update, @conference.events.new
|
||||
event = Event.where(guid: params[:event]).first
|
||||
error_message = nil
|
||||
if event.nil?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue