mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
It's always hard to remove another layer of indirection...
This commit is contained in:
parent
6ab1bddd82
commit
b95d35d5d9
6 changed files with 5 additions and 16 deletions
|
|
@ -38,17 +38,6 @@ class ApplicationController < ActionController::Base
|
||||||
@conferences =Conference.all
|
@conferences =Conference.all
|
||||||
end
|
end
|
||||||
|
|
||||||
def verify_user
|
|
||||||
:authenticate_user!
|
|
||||||
|
|
||||||
if (current_user.nil?)
|
|
||||||
redirect_to new_user_session_path
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
true
|
|
||||||
end
|
|
||||||
|
|
||||||
def current_ability
|
def current_ability
|
||||||
@current_ability ||= Ability.new(current_user)
|
@current_ability ||= Ability.new(current_user)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
class ConferenceRegistrationsController < ApplicationController
|
class ConferenceRegistrationsController < ApplicationController
|
||||||
before_filter :verify_user
|
before_filter :authenticate_user!
|
||||||
load_resource :conference, find_by: :short_title
|
load_resource :conference, find_by: :short_title
|
||||||
authorize_resource :conference_registrations, class: Registration
|
authorize_resource :conference_registrations, class: Registration
|
||||||
before_action :set_registration, only: [:edit, :update, :destroy, :show]
|
before_action :set_registration, only: [:edit, :update, :destroy, :show]
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
class ProposalController < ApplicationController
|
class ProposalController < ApplicationController
|
||||||
before_filter :verify_user, except: [:show]
|
before_filter :authenticate_user!, except: [:show]
|
||||||
load_resource :conference, find_by: :short_title
|
load_resource :conference, find_by: :short_title
|
||||||
load_and_authorize_resource :event, parent: false, through: :conference
|
load_and_authorize_resource :event, parent: false, through: :conference
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
class TicketPurchasesController < ApplicationController
|
class TicketPurchasesController < ApplicationController
|
||||||
before_filter :verify_user
|
before_filter :authenticate_user!
|
||||||
load_resource :conference, find_by: :short_title
|
load_resource :conference, find_by: :short_title
|
||||||
authorize_resource :conference_registrations, class: Registration
|
authorize_resource :conference_registrations, class: Registration
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
class TicketsController < ApplicationController
|
class TicketsController < ApplicationController
|
||||||
before_filter :verify_user
|
before_filter :authenticate_user!
|
||||||
load_resource :conference, find_by: :short_title
|
load_resource :conference, find_by: :short_title
|
||||||
load_resource :tickets, class: Ticket
|
load_resource :tickets, class: Ticket
|
||||||
authorize_resource :conference_registrations, class: Registration
|
authorize_resource :conference_registrations, class: Registration
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
class UsersController < ApplicationController
|
class UsersController < ApplicationController
|
||||||
before_filter :verify_user
|
before_filter :authenticate_user!
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|
||||||
# GET /users/1
|
# GET /users/1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue