add cancancan ability for creating transactions

This commit is contained in:
Ilion Beyst 2015-09-09 16:51:41 +02:00
parent e67a660959
commit 3a0d5f1017
2 changed files with 2 additions and 0 deletions

View file

@ -1,4 +1,5 @@
class TransactionsController < ApplicationController
load_and_authorize_resource
skip_before_filter :verify_authenticity_token, only: :create
before_action :authenticate_user!, except: :create

View file

@ -8,6 +8,7 @@ class Ability
can :manage, :all
else
can :read, user, id: user.id
can :create, Transaction, debtor: user
end
end
end