12 lines
244 B
Ruby
12 lines
244 B
Ruby
class Ability
|
|
include CanCan::Ability
|
|
def initialize(settings)
|
|
settings ||= SupplierEmployeesSettings.new(Supplier.new).for_employee(nil)
|
|
if settings.manager?
|
|
can :manage, :all
|
|
else
|
|
can :read, :all
|
|
end
|
|
end
|
|
end
|