Sha256: e2829a32f0bef8d329e782672b6308b69394d5cede058d96a166f8d5d993250d

Contents?: true

Size: 269 Bytes

Versions: 18

Compression:

Stored size: 269 Bytes

Contents

class UserPolicy
  attr_reader :current_user, :model

  def initialize(current_user, model)
    @current_user = current_user
    @user = model
  end

  def index?
    @current_user.admin?
  end

  def show?
    @current_user.admin? or @current_user == @user
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
rails_apps_pages-0.6.7 lib/generators/pages/authorized/templates/omniauth/user_policy.rb
rails_apps_pages-0.6.6 lib/generators/pages/authorized/templates/omniauth/user_policy.rb
rails_apps_pages-0.6.5 lib/generators/pages/authorized/templates/omniauth/user_policy.rb
rails_apps_pages-0.6.4 lib/generators/pages/authorized/templates/omniauth/user_policy.rb
rails_apps_pages-0.6.3 lib/generators/pages/authorized/templates/omniauth/user_policy.rb
rails_apps_pages-0.6.2 lib/generators/pages/authorized/templates/omniauth/user_policy.rb
rails_apps_pages-0.6.0 lib/generators/pages/authorized/templates/omniauth/user_policy.rb
rails_apps_pages-0.5.16 lib/generators/pages/authorized/templates/omniauth/user_policy.rb
rails_apps_pages-0.5.15 lib/generators/pages/authorized/templates/omniauth/user_policy.rb
rails_apps_pages-0.5.14 lib/generators/pages/authorized/templates/omniauth/user_policy.rb
rails_apps_pages-0.5.13 lib/generators/pages/authorized/templates/omniauth/user_policy.rb
rails_apps_pages-0.5.12 lib/generators/pages/authorized/templates/omniauth/user_policy.rb
rails_apps_pages-0.5.11 lib/generators/pages/authorized/templates/omniauth/user_policy.rb
rails_apps_pages-0.5.10 lib/generators/pages/authorized/templates/omniauth/user_policy.rb
rails_apps_pages-0.5.9 lib/generators/pages/authorized/templates/omniauth/user_policy.rb
rails_apps_pages-0.5.8 lib/generators/pages/authorized/templates/omniauth/user_policy.rb
rails_apps_pages-0.5.7 lib/generators/pages/authorized/templates/omniauth/user_policy.rb
rails_apps_pages-0.5.6 lib/generators/pages/authorized/templates/omniauth/user_policy.rb