Sha256: 7b5aaaa8b153f1091b9d7a62f9bfc20a80879f64052dba2ad71e4abd0928703b
Contents?: true
Size: 637 Bytes
Versions: 3
Compression:
Stored size: 637 Bytes
Contents
# frozen_string_literal: true # generado con pg_rails class AccountPolicy < ApplicationPolicy class Scope < ApplicationPolicy::Scope # def resolve # if policy.acceso_total? # scope.all # else # scope.none # end # end end def puede_editar? user.developer? end def puede_crear? user.developer? end def puede_borrar? user.developer? end # def acceso_total? # user.developer? # end def new_from_associable? false end def base_access_to_record? ActsAsTenant.unscoped? || record.user_accounts.pluck(:user_id).include?(user.id) end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
pg_rails-7.6.20 | pg_engine/app/policies/account_policy.rb |
pg_rails-7.6.19 | pg_engine/app/policies/account_policy.rb |
pg_rails-7.6.18 | pg_engine/app/policies/account_policy.rb |