Poltergeist in the green, and resourceful refactor

This commit is contained in:
2015-02-27 15:12:08 +01:00
parent d1015dcc88
commit 046058b5d2
31 changed files with 210 additions and 165 deletions
+6
View File
@@ -0,0 +1,6 @@
class Employees::Ability
include CanCan::Ability
def initialize(employee)
can :read, Supplier
end
end
+19
View File
@@ -0,0 +1,19 @@
class Suppliers::Ability
include CanCan::Ability
def initialize(employee)
if employee.manager?
can :manage, :all
#cam :mark_as_open, Supplier
else
can :read, :all
can :qr_codes, Table
can :home, Supplier
can :current, :all
can :close, List
can :mark_helped, List
can :mark_in_process, Order
can :mark_delivered, Order
can :cancel, Order
end
end
end