spree_auth 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of spree_auth might be problematic. Click here for more details.

@@ -4,12 +4,12 @@ Spree::Admin::BaseController.class_eval do
4
4
 
5
5
  def authorize_admin
6
6
  begin
7
- model = model_class
7
+ record = model_class.new
8
8
  rescue
9
- model = Object
9
+ record = Object.new
10
10
  end
11
- authorize! :admin, model
12
- authorize! params[:action].to_sym, model
11
+ authorize! :admin, record
12
+ authorize! params[:action].to_sym, record
13
13
  end
14
14
 
15
15
  protected
@@ -6,7 +6,7 @@ Spree::Admin::OrdersController.class_eval do
6
6
  load_order
7
7
  session[:access_token] ||= params[:token]
8
8
 
9
- resource = @order || Spree::Order
9
+ resource = @order || Spree::Order.new
10
10
  action = params[:action].to_sym
11
11
 
12
12
  authorize! action, resource, session[:access_token]
@@ -9,7 +9,7 @@ Spree::OrdersController.class_eval do
9
9
  if order
10
10
  authorize! :edit, order, session[:access_token]
11
11
  else
12
- authorize! :create, Spree::Order
12
+ authorize! :create, Spree::Order.new
13
13
  end
14
14
  end
15
15
  end
@@ -0,0 +1,13 @@
1
+ Spree::ProductsController.class_eval do
2
+ rescue_from CanCan::AccessDenied, :with => :render_404
3
+
4
+ private
5
+ def load_product
6
+ @product = Spree::Product.find_by_permalink!(params[:id])
7
+ if !@product.deleted? && (@product.available_on.nil? || @product.available_on.future?)
8
+ # Allow admins to view any yet to be available products
9
+ raise CanCan::AccessDenied unless current_user && current_user.admin?
10
+ end
11
+ end
12
+ end
13
+
@@ -42,7 +42,7 @@ class Spree::UsersController < Spree::BaseController
42
42
  end
43
43
 
44
44
  def authorize_actions
45
- authorize! params[:action].to_sym, Spree::User
45
+ authorize! params[:action].to_sym, Spree::User.new
46
46
  end
47
47
 
48
48
  def accurate_title
@@ -1,6 +1,7 @@
1
1
  Deface::Override.new(:virtual_path => "spree/admin/payment_methods/index",
2
2
  :name => "gateway_banner",
3
3
  :insert_after => "#listing_payment_methods",
4
- :partial => "spree/admin/banners/gateway")
4
+ :partial => "spree/admin/banners/gateway",
5
+ :original => '93c6a827573cd5b5410992477389e178b9965630' )
5
6
 
6
7
 
@@ -1,4 +1,5 @@
1
1
  Deface::Override.new(:virtual_path => "spree/layouts/admin",
2
2
  :name => "auth_admin_login_navigation_bar",
3
3
  :replace => "[data-hook='admin_login_navigation_bar'], #admin_login_navigation_bar[data-hook]",
4
- :partial => "spree/layouts/admin/login_nav")
4
+ :partial => "spree/layouts/admin/login_nav",
5
+ :original => '0a5476d4d5db90ec8dd200ebaa0109a6a54ec6bc' )
@@ -2,4 +2,5 @@ Deface::Override.new(:virtual_path => "spree/admin/users/_form",
2
2
  :name => "auth_admin_user_roles",
3
3
  :insert_after => "[data-hook='admin_user_form_fields']",
4
4
  :partial => "spree/admin/users/roles",
5
- :disabled => false)
5
+ :disabled => false,
6
+ :original => '0e121156115799a53f5c5dddfb65c1ec80cb5f09')
@@ -2,5 +2,6 @@ Deface::Override.new(:virtual_path => "spree/shared/_nav_bar",
2
2
  :name => "auth_shared_login_bar",
3
3
  :insert_before => "li#search-bar",
4
4
  :partial => "spree/shared/login_bar",
5
- :disabled => false)
5
+ :disabled => false,
6
+ :original => 'eb3fa668cd98b6a1c75c36420ef1b238a1fc55ac')
6
7
 
@@ -2,4 +2,5 @@ Deface::Override.new(:virtual_path => "spree/checkout/registration",
2
2
  :name => "auth_user_login_form",
3
3
  :replace_contents => "[data-hook='registration'] #account, #registration[data-hook] #account",
4
4
  :template => "spree/user_sessions/new",
5
- :disabled => false)
5
+ :disabled => false,
6
+ :original => 'ab20ac9e90baa11b847b30040aef863d2e1af17a')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,33 +9,33 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-28 00:00:00.000000000 Z
12
+ date: 2012-05-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: spree_core
16
- requirement: &70189511168680 !ruby/object:Gem::Requirement
16
+ requirement: &70261468871880 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - =
20
20
  - !ruby/object:Gem::Version
21
- version: 1.1.0
21
+ version: 1.1.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70189511168680
24
+ version_requirements: *70261468871880
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: devise
27
- requirement: &70189511168160 !ruby/object:Gem::Requirement
27
+ requirement: &70261468871080 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
31
31
  - !ruby/object:Gem::Version
32
- version: '2.0'
32
+ version: 2.0.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70189511168160
35
+ version_requirements: *70261468871080
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: cancan
38
- requirement: &70189511167300 !ruby/object:Gem::Requirement
38
+ requirement: &70261468870180 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - =
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 1.6.7
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70189511167300
46
+ version_requirements: *70261468870180
47
47
  description: Required dependency for Spree
48
48
  email: sean@spreecommerce.com
49
49
  executables: []
@@ -63,6 +63,7 @@ files:
63
63
  - app/controllers/spree/base_controller_decorator.rb
64
64
  - app/controllers/spree/checkout_controller_decorator.rb
65
65
  - app/controllers/spree/orders_controller_decorator.rb
66
+ - app/controllers/spree/products_controller_decorator.rb
66
67
  - app/controllers/spree/user_passwords_controller.rb
67
68
  - app/controllers/spree/user_registrations_controller.rb
68
69
  - app/controllers/spree/user_sessions_controller.rb
@@ -133,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
134
  version: '0'
134
135
  segments:
135
136
  - 0
136
- hash: -910771523182878833
137
+ hash: 2326672717691546910
137
138
  requirements:
138
139
  - none
139
140
  rubyforge_project: