mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-17 05:34:04 +00:00
Implement role authorization
This commit is contained in:
parent
6755328c4c
commit
e2fb434dc7
122 changed files with 1386 additions and 751 deletions
|
|
@ -1,6 +1,7 @@
|
|||
module Admin
|
||||
class EventsController < ApplicationController
|
||||
before_filter :verify_organizer
|
||||
load_and_authorize_resource :conference, find_by: :short_title
|
||||
load_and_authorize_resource :event, through: :conference
|
||||
|
||||
before_action :get_event, except: [:index, :create]
|
||||
|
||||
|
|
@ -13,6 +14,8 @@ module Admin
|
|||
end
|
||||
|
||||
def index
|
||||
authorize! :index, @conference.events.build
|
||||
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||
@events = @conference.events
|
||||
@tracks = @conference.tracks
|
||||
@machine_states = @events.state_machine.states.map
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue