2015-09-11 11:16:53 +00:00
|
|
|
class ClientAbility
|
2015-09-09 09:24:45 +00:00
|
|
|
include CanCan::Ability
|
|
|
|
|
|
|
|
def initialize(client)
|
|
|
|
client ||= Client.new # guest user (not logged in)
|
2017-01-23 15:59:04 +00:00
|
|
|
|
|
|
|
can :create, Transaction if client.has_role? :create_transactions
|
|
|
|
can :create, Request
|
2017-01-23 16:45:57 +00:00
|
|
|
can :read, User
|
2015-09-09 09:24:45 +00:00
|
|
|
end
|
|
|
|
end
|