Sha256: dd8e2a06c016128140b8b811f8464ad8aa5c1646b9ba78c6c9f46fa3ce56313a

Contents?: true

Size: 505 Bytes

Versions: 14

Compression:

Stored size: 505 Bytes

Contents

begin
  require_dependency "#{Rails.application.class.parent_name.underscore}/roles"
rescue LoadError => e
  Rails.logger.warn "!! You have not defined roles."
  Rails.logger.warn "!! Please define it in lib/#{Rails.application.class.parent_name.underscore}/roles."
  Rails.logger.warn "!! EgovUtils roles management will not work without it."
end

class Ability
  include CanCan::Ability

  def initialize(user)
    user.all_roles.each do |role|
      role.define_abilities(self, user)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
egov_utils-0.1.17 app/models/ability.rb
egov_utils-0.1.16 app/models/ability.rb
egov_utils-0.1.15 app/models/ability.rb
egov_utils-0.1.14 app/models/ability.rb
egov_utils-0.1.13 app/models/ability.rb
egov_utils-0.1.12 app/models/ability.rb
egov_utils-0.1.11 app/models/ability.rb
egov_utils-0.1.10 app/models/ability.rb
egov_utils-0.1.9 app/models/ability.rb
egov_utils-0.1.8 app/models/ability.rb
egov_utils-0.1.7 app/models/ability.rb
egov_utils-0.1.6 app/models/ability.rb
egov_utils-0.1.5 app/models/ability.rb
egov_utils-0.1.4 app/models/ability.rb