Sha256: 9911ccb3d92442f940133f6674443fe61da4b7173976e497c0054eeefbacb30e

Contents?: true

Size: 596 Bytes

Versions: 5

Compression:

Stored size: 596 Bytes

Contents

if defined?(Permissive)
  # Setup some basic models to test with. We'll set permissions on both,
  # and then test :scope'd permissions through both.
  class Permissive::Organization < ActiveRecord::Base
    set_table_name :permissive_organizations
  end

  class Permissive::User < ActiveRecord::Base
    set_table_name :permissive_users
  end

  class UserWithRole < ActiveRecord::Base
    set_table_name :permissive_users_with_roles

    has_permissions do
      to :eat, 0
      to :sleep, 1

      role(:hungry_person) { can :eat }
      role(:sleepy_person) { can :sleep }
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
permissive-0.2.9.alpha spec/spec_models.rb
permissive-0.2.8.alpha spec/spec_models.rb
permissive-0.2.7.alpha spec/spec_models.rb
permissive-0.2.6.alpha spec/spec_models.rb
permissive-0.2.5.alpha spec/spec_models.rb