afimb/chouette2

View on GitHub
app/policies/application_policy.rb

Summary

Maintainability
A
0 mins
Test Coverage
class ApplicationPolicy
  attr_reader :user, :record

  def initialize(user, record)
    @user = user || User.new
    @record = record
  end

  def read?
    @user.read?
  end

  def write?
    !@user.read?
  end
end