Sha256: 9beaff64613911cc8725ef27ca508c46982cbe4eb534fd4ce8f91f8b88574864

Contents?: true

Size: 241 Bytes

Versions: 14

Compression:

Stored size: 241 Bytes

Contents

class UserPolicy
  attr_reader :user, :record

  def initialize(user, record)
    @user = user
    @record = record
  end

  def index?
    @user.admin?
  end

  def update?
    @user.admin?
  end

  def destroy?
    @user.admin?
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rails_apps_pages-0.5.0 lib/generators/pages/authorized/templates/user_policy.rb
rails_apps_pages-0.4.9 lib/generators/pages/authorized/templates/user_policy.rb
rails_apps_pages-0.4.8 lib/generators/pages/authorized/templates/user_policy.rb
rails_apps_pages-0.4.7 lib/generators/pages/authorized/templates/user_policy.rb
rails_apps_pages-0.4.6 lib/generators/pages/authorized/templates/user_policy.rb
rails_apps_pages-0.4.5 lib/generators/pages/authorized/templates/user_policy.rb
rails_apps_pages-0.4.4 lib/generators/pages/authorized/templates/user_policy.rb
rails_apps_pages-0.4.3 lib/generators/pages/authorized/templates/user_policy.rb
rails_apps_pages-0.4.2 lib/generators/pages/authorized/templates/user_policy.rb
rails_apps_pages-0.4.1 lib/generators/pages/authorized/templates/user_policy.rb
rails_apps_pages-0.4.0 lib/generators/pages/authorized/templates/user_policy.rb
rails_apps_pages-0.3.1 lib/generators/pages/authorized/templates/user_policy.rb
rails_apps_pages-0.3.0 lib/generators/pages/authorized/templates/user_policy.rb
rails_apps_pages-0.2.0 lib/generators/pages/authorized/templates/user_policy.rb