Sha256: 2e5b32d368872f9b4f8594f6fac4288eac7476aab97bba3b5e3261024f4eabba

Contents?: true

Size: 272 Bytes

Versions: 8

Compression:

Stored size: 272 Bytes

Contents

module EnjuNii
  class Ability
    include CanCan::Ability

    def initialize(user, ip_address = nil)
      case user.try(:role).try(:name)
      when 'Administrator'
        can [:read, :update], NiiType
      else
        can :read, NiiType
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
enju_nii-0.1.0.pre11 app/models/enju_nii/ability.rb
enju_nii-0.1.0.pre10 app/models/enju_nii/ability.rb
enju_nii-0.1.0.pre9 app/models/enju_nii/ability.rb
enju_nii-0.1.0.pre8 app/models/enju_nii/ability.rb
enju_nii-0.1.0.pre7 app/models/enju_nii/ability.rb
enju_nii-0.1.0.pre6 app/models/enju_nii/ability.rb
enju_nii-0.1.0.pre5 app/models/enju_nii/ability.rb
enju_nii-0.1.0.pre4 app/models/enju_nii/ability.rb