mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Move abilities for admin views in separate model
This commit is contained in:
parent
ea43b19ef4
commit
366fced200
6 changed files with 676 additions and 572 deletions
|
|
@ -2,6 +2,12 @@ module Admin
|
|||
class BaseController < ApplicationController
|
||||
before_filter :verify_user_admin
|
||||
|
||||
private
|
||||
|
||||
def current_ability
|
||||
@current_ability ||= AdminAbility.new(current_user)
|
||||
end
|
||||
|
||||
def verify_user_admin
|
||||
if (current_user.nil?)
|
||||
redirect_to sign_in_path
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
module Admin
|
||||
class RegistrationPeriodsController < ApplicationController
|
||||
class RegistrationPeriodsController < Admin::BaseController
|
||||
load_and_authorize_resource :conference, find_by: :short_title
|
||||
load_and_authorize_resource through: :conference, singleton: true
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue