go_gamification 0.0.17 → 0.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 891047e4cc20a13870e6411b625a999bafdd0a4c
4
- data.tar.gz: d36badf7343ee4a6346e6253fd082da9f05a9baa
3
+ metadata.gz: c06f74bd183f59f37f66f0db1a1aa0df7580decc
4
+ data.tar.gz: b08c33ce22d0663f633d1b4cb5f064623237c1ea
5
5
  SHA512:
6
- metadata.gz: 2616722fffb3a7c6cacbb62249351923c307ce169105c4acf014402fbd94046112a0d12fc35fb305d48fa04a4047a4d3bc03b2536edfb2583679fcdb1ff1e8c6
7
- data.tar.gz: e5b406939097c5688237bcd298a23513254a2e5065c1f6ffd3a1d8c6e864ff520e71bff24603f2f13528a84afe783e30be7f5e85c3e06fd9cb278bb63e41145d
6
+ metadata.gz: f61b58088473e21be41c844c70931ed9c710a11cea7ce168ee78d401f22a4252a983a9c7dc3f7429fdedefda252840649b843a6ad09ce42d1184e79e8b5ee915
7
+ data.tar.gz: 6d3acf5bd7f98bc78176eb02f9c99401167239796e4f03c81e3db8cb50aef8acca78bca3b9d3f50c422b17ea5d99031d2ebc80e6f321ac6c689a0965df474c03
@@ -1,6 +1,8 @@
1
1
  class Gamification::InventoriesController < ApplicationController
2
2
  before_action :set_gamification_inventory, only: [:show, :edit, :update, :destroy]
3
3
  before_action :set_user, only: [:update]
4
+ before_action :authenticate_user!
5
+ load_and_authorize_resource except: [:create]
4
6
 
5
7
  # GET /gamification/inventories
6
8
  def index
@@ -22,6 +24,8 @@ class Gamification::InventoriesController < ApplicationController
22
24
 
23
25
  # POST /gamification/inventories
24
26
  def create
27
+ authorize! :create, @gamification_inventory
28
+
25
29
  @gamification_inventory = Gamification::Inventory.new(inventory_params)
26
30
 
27
31
  if @gamification_inventory.save
@@ -1,6 +1,7 @@
1
1
  class Gamification::ItemGroupsController < ApplicationController
2
2
  before_action :set_gamification_item_group, only: [:show, :edit, :update, :destroy]
3
-
3
+ before_action :authenticate_user!
4
+ load_and_authorize_resource except: [:create]
4
5
  # GET /gamification/item_groups
5
6
  def index
6
7
  @gamification_item_groups = Gamification::ItemGroup.all
@@ -21,6 +22,8 @@ class Gamification::ItemGroupsController < ApplicationController
21
22
 
22
23
  # POST /gamification/item_groups
23
24
  def create
25
+ authorize! :create, @gamification_item_group
26
+
24
27
  @gamification_item_group = Gamification::ItemGroup.new(gamification_item_group_params)
25
28
 
26
29
  if @gamification_item_group.save
@@ -1,6 +1,7 @@
1
1
  class Gamification::ItemTypesController < ApplicationController
2
2
  before_action :set_gamification_item_type, only: [:show, :edit, :update, :destroy]
3
-
3
+ before_action :authenticate_user!
4
+ load_and_authorize_resource except: [:create]
4
5
  # GET /gamification/item_types
5
6
  def index
6
7
  @gamification_item_types = Gamification::ItemType.all
@@ -21,6 +22,8 @@ class Gamification::ItemTypesController < ApplicationController
21
22
 
22
23
  # POST /gamification/item_types
23
24
  def create
25
+ authorize! :create, @gamification_item_type
26
+
24
27
  @gamification_item_type = Gamification::ItemType.new(gamification_item_type_params)
25
28
 
26
29
  if @gamification_item_type.save
@@ -1,6 +1,7 @@
1
1
  class Gamification::ItemsController < ApplicationController
2
2
  before_action :set_gamification_item, only: [:show, :edit, :update, :destroy]
3
-
3
+ before_action :authenticate_user!
4
+ load_and_authorize_resource except: [:create]
4
5
  # GET /gamification/items
5
6
  def index
6
7
  @gamification_items = Gamification::Item.all
@@ -21,6 +22,8 @@ class Gamification::ItemsController < ApplicationController
21
22
 
22
23
  # POST /gamification/items
23
24
  def create
25
+ authorize! :create, @gamification_item
26
+
24
27
  @gamification_item = Gamification::Item.new(gamification_item_params)
25
28
 
26
29
  if @gamification_item.save
@@ -1,7 +1,8 @@
1
1
  module Gamification
2
2
  class LevelsController < ApplicationController
3
-
4
- before_action :set_level, only: [:show, :edit, :update, :destroy]
3
+ before_action :authenticate_user!, except: [:list, :show_list]
4
+ before_action :authenticate_user!
5
+ load_and_authorize_resource except: [:create]
5
6
 
6
7
  # GET /levels
7
8
  def index
@@ -23,6 +24,8 @@ module Gamification
23
24
 
24
25
  # POST /levels
25
26
  def create
27
+ authorize! :create, @level
28
+
26
29
  @level = Level.new(level_params)
27
30
 
28
31
  if @level.save
@@ -1,6 +1,8 @@
1
1
  module Gamification
2
2
  class RewardsController < ApplicationController
3
3
  before_action :verify_checksum
4
+ before_action :authenticate_user!
5
+ load_and_authorize_resource except: [:create]
4
6
 
5
7
  def create
6
8
  if rewarding.is_a? ::Gamification::Goal
@@ -1,3 +1,3 @@
1
1
  module GoGamification
2
- VERSION = "0.0.17"
2
+ VERSION = "0.0.18"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: go_gamification
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - João Carlos Ottobboni