Merge pull request #942 from nishanthvijayan/fix-roles-authorization

Fix authorization issues with Roles
This commit is contained in:
Stella Rouzi 2016-04-25 17:18:24 +02:00
commit 0a5ba7a204
6 changed files with 77 additions and 51 deletions

View file

@ -2,11 +2,13 @@ module Admin
class RolesController < Admin::BaseController
load_and_authorize_resource :conference, find_by: :short_title
before_action :set_selection
authorize_resource :role, except: :index
# Show flash message with ajax calls
after_action :prepare_unobtrusive_flash, only: :toggle_user
def index
@roles = Role.where(resource: @conference)
authorize! :index, @role
end
def show