Class: Dscf::Marketplace::AggregatorListingPolicy
- Inherits:
-
Core::ApplicationPolicy
- Object
- Core::ApplicationPolicy
- Dscf::Marketplace::AggregatorListingPolicy
- Defined in:
- app/policies/dscf/marketplace/aggregator_listing_policy.rb
Instance Method Summary collapse
- #create? ⇒ Boolean
- #feed? ⇒ Boolean
- #index? ⇒ Boolean
- #my_listings? ⇒ Boolean
- #show? ⇒ Boolean
- #update? ⇒ Boolean
Instance Method Details
#create? ⇒ Boolean
12 13 14 |
# File 'app/policies/dscf/marketplace/aggregator_listing_policy.rb', line 12 def create? user.present? end |
#feed? ⇒ Boolean
20 21 22 |
# File 'app/policies/dscf/marketplace/aggregator_listing_policy.rb', line 20 def feed? true end |
#index? ⇒ Boolean
4 5 6 |
# File 'app/policies/dscf/marketplace/aggregator_listing_policy.rb', line 4 def index? true end |
#my_listings? ⇒ Boolean
24 25 26 |
# File 'app/policies/dscf/marketplace/aggregator_listing_policy.rb', line 24 def my_listings? user.present? end |
#show? ⇒ Boolean
8 9 10 |
# File 'app/policies/dscf/marketplace/aggregator_listing_policy.rb', line 8 def show? true end |
#update? ⇒ Boolean
16 17 18 |
# File 'app/policies/dscf/marketplace/aggregator_listing_policy.rb', line 16 def update? user.present? && record.aggregator_id.in?(user.businesses.pluck(:id)) end |