Newer
Older
dmpopidor / app / policies / home_policy.rb
@xsrust xsrust on 16 Sep 2016 273 bytes added auth to home controller
class UserPolicy < ApplicationPolicy
  attr_reader :user

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

  def index?
    true
  end

  class Scope < Scope
    def resolve
      scope.where(organisation_id: user.organisation_id)
    end
  end

end