Sha256: b6f1e617a348071ead8bda5bcda04340016f6e65f80340506a60bcff9a131db3

Contents?: true

Size: 659 Bytes

Versions: 1

Compression:

Stored size: 659 Bytes

Contents

module Adminsite
  class Ability
    include CanCan::Ability

    def initialize(user)
      user ||= AdminUser.new
      user.admin_user_roles.each do |role|
        case role.name.to_sym
        when :admin
          can :manage, :all
        when :editor
          can :read, Adminsite::Page
          can :read, Adminsite::PageLayout
          can :read, Adminsite::FileAsset
          can :read, Adminsite::AdminUser
          can :read, Adminsite::AdminUserRole
        when :customer
          # can :read, Adminsite::Page
          # can :read, Adminsite::PageLayout
          # can :read, Adminsite::FileAsset
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
adminsite-3.0.0 app/models/adminsite/ability.rb