Fix the ability spec
* Get rid of the volunteer coordinator role, we don't use it currently * Test the ability with users that exclusively have a single role
This commit is contained in:
parent
e8ab94e1c7
commit
0ce4aa0a49
3 changed files with 13 additions and 82 deletions
|
|
@ -1,7 +1,7 @@
|
|||
module Admin
|
||||
class RegistrationsController < Admin::BaseController
|
||||
load_and_authorize_resource :conference, find_by: :short_title
|
||||
load_and_authorize_resource through: :conference
|
||||
load_and_authorize_resource :registration, through: :conference
|
||||
before_filter :set_user, except: [:index]
|
||||
|
||||
def index
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ class Ability
|
|||
# can view others
|
||||
can :show, User
|
||||
# can register
|
||||
can [:show, :create], Registration do |registration|
|
||||
can [:read, :create], Registration do |registration|
|
||||
registration.new_record?
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue