add cancancan ability for creating transactions
This commit is contained in:
parent
e67a660959
commit
3a0d5f1017
2 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -8,6 +8,7 @@ class Ability
|
|||
can :manage, :all
|
||||
else
|
||||
can :read, user, id: user.id
|
||||
can :create, Transaction, debtor: user
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue