Sha256: 9d61e4e86e36743b04f05893f6b042f50a7e6e7703f27381d28de4b8a65585b6

Contents?: true

Size: 274 Bytes

Versions: 8

Compression:

Stored size: 274 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 spec/dummy/app/models/ability.rb
enju_nii-0.1.0.pre10 spec/dummy/app/models/ability.rb
enju_nii-0.1.0.pre9 spec/dummy/app/models/ability.rb
enju_nii-0.1.0.pre8 spec/dummy/app/models/ability.rb
enju_nii-0.1.0.pre7 spec/dummy/app/models/ability.rb
enju_nii-0.1.0.pre6 spec/dummy/app/models/ability.rb
enju_nii-0.1.0.pre5 spec/dummy/app/models/ability.rb
enju_nii-0.1.0.pre4 spec/dummy/app/models/ability.rb