rubyforgood/casa

View on GitHub
app/policies/casa_org_policy.rb

Summary

Maintainability
A
0 mins
Test Coverage
B
85%
class CasaOrgPolicy < ApplicationPolicy
  def edit?
    record.users.include?(user) && is_admin?
  end

  def update?
    record.users.include?(user) && is_admin?
  end

  def same_org?
    user&.casa_org.present? && user.casa_org == record
  end
end