Method: Pageflow::UserPolicy::Scope#resolve
- Defined in:
- app/policies/pageflow/user_policy.rb
#resolve ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/policies/pageflow/user_policy.rb', line 13 def resolve if user.admin? scope.all else manager_accounts_ids = AccountPolicy::Scope .new(@user, Account).member_addable.map(&:id) scope.joins(:memberships) .where('pageflow_memberships.entity_type = \'Pageflow::Account\'') .where(membership_in_managed_account(manager_accounts_ids)).distinct end end |