effective_orders 1.5.9 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0979421d5081d8f2de0a821d896cb361aa64ed8a
4
- data.tar.gz: 306fc9bf0fea8630dc63989e63c0678db5d6448c
3
+ metadata.gz: 9594a00af04e8a3fa775560e34d35e9181e70919
4
+ data.tar.gz: 78aca75f4a95e83b1d512c8537346bba1f41a78f
5
5
  SHA512:
6
- metadata.gz: 5c095c5d4924bfe1388a586d7160fe3e4b7bd0e005204be2856d31093baf74411beada109c1fc5c73bed9bcc6d52a65c45143b52e7032de9f06b4a31189cefd7
7
- data.tar.gz: 7f662b1fd88f91ccdffeb5f7071f783aabf8dba8db2ae25423bede9e7170a3715eb6beeec3332fd6be9bcca23fc43d9e2724faaf51da5f36ce8c539f5d959ebd
6
+ metadata.gz: c32c82987c9746f17821c14da0f8d83ede0a180290eb6ad9813f5cda5cc0cbf76ec900e581279e9355247146e1d0aca3f3314658240fe1c371028d21aa8edaf4
7
+ data.tar.gz: 5aebd22e4161a00b0db47c7b606055f884e29d4a9f9b1a800fa97aa23b7cfa5c7a789b9e89bf2148ebaf11980144e5be84debc74ab805cb6771f5b3480c1bc8f
data/README.md CHANGED
@@ -406,7 +406,7 @@ end
406
406
 
407
407
  ### Permissions
408
408
 
409
- The permissions you actually want to define are as follows (using CanCan):
409
+ The permissions you actually want to define for a regular user are as follows (using CanCan):
410
410
 
411
411
  ```ruby
412
412
  can [:manage], Effective::Cart, :user_id => user.id
@@ -414,6 +414,13 @@ can [:manage], Effective::Order, :user_id => user.id # Orders cannot be deleted
414
414
  can [:manage], Effective::Subscription, :user_id => user.id
415
415
  ```
416
416
 
417
+ In addition to the above, the following permissions allow access to the `/admin` screens:
418
+
419
+ ```ruby
420
+ can :admin, :effective_orders # Can access the admin screens
421
+ can :show, :payment_details # Can see the payment purchase details on orders
422
+ ```
423
+
417
424
  ## Whats Included
418
425
 
419
426
  This gem has a lot of screens, all of which are automatically available via the Rails Engine.
@@ -754,6 +761,8 @@ Once Order id=1 has been purchased/declined, you will be unable to purchase an o
754
761
 
755
762
  ## Paying via Stripe
756
763
 
764
+ Make sure `gem 'stripe'` is included in your Gemfile.
765
+
757
766
  First register for an account with Stripe
758
767
 
759
768
  https://manage.stripe.com/register
@@ -3,11 +3,12 @@ module Admin
3
3
  before_filter :authenticate_user! # This is devise, ensure we're logged in.
4
4
 
5
5
  layout (EffectiveOrders.layout.kind_of?(Hash) ? EffectiveOrders.layout[:admin_customers] : EffectiveOrders.layout)
6
-
6
+
7
7
  def index
8
8
  @datatable = Effective::Datatables::Customers.new() if defined?(EffectiveDatatables)
9
9
  @page_title = 'Customers'
10
10
 
11
+ EffectiveOrders.authorized?(self, :admin, :effective_orders)
11
12
  EffectiveOrders.authorized?(self, :index, Effective::Customer)
12
13
  end
13
14
 
@@ -8,6 +8,7 @@ module Admin
8
8
  @datatable = Effective::Datatables::OrderItems.new() if defined?(EffectiveDatatables)
9
9
  @page_title = 'Order Items'
10
10
 
11
+ EffectiveOrders.authorized?(self, :admin, :effective_orders)
11
12
  EffectiveOrders.authorized?(self, :index, Effective::OrderItem)
12
13
  end
13
14
  end
@@ -8,6 +8,7 @@ module Admin
8
8
  @datatable = Effective::Datatables::Orders.new() if defined?(EffectiveDatatables)
9
9
  @page_title = 'Orders'
10
10
 
11
+ EffectiveOrders.authorized?(self, :admin, :effective_orders)
11
12
  EffectiveOrders.authorized?(self, :index, Effective::Order)
12
13
  end
13
14
 
@@ -6,5 +6,5 @@
6
6
  = render partial: 'effective/orders/order_shipping', locals: {order: order}
7
7
  = render partial: 'effective/orders/order_items', locals: {order: order}
8
8
 
9
- - if (EffectiveOrders.authorized?(controller, :manage, Effective::Order) rescue false)
9
+ - if (EffectiveOrders.authorized?(controller, :show, :payment_details) rescue false)
10
10
  = render partial: 'effective/orders/order_payment_details', locals: {order: order}
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '1.5.9'.freeze
2
+ VERSION = '1.6.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_orders
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.9
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
@@ -136,20 +136,6 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: 1.0.2
139
- - !ruby/object:Gem::Dependency
140
- name: stripe
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: 1.19.0
146
- type: :runtime
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: 1.19.0
153
139
  - !ruby/object:Gem::Dependency
154
140
  name: stripe-ruby-mock
155
141
  requirement: !ruby/object:Gem::Requirement