hackathon_manager 0.13.0 → 0.13.1

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
  SHA256:
3
- metadata.gz: ac76ddc635787194b110815a1d4644597c6764de671879e922f6aa16cdb95c4f
4
- data.tar.gz: 322bfb6e07da66de298b84d5340c27b2955ce4e70b63a612809f66e05d1c973a
3
+ metadata.gz: edbee88bd48b0012031f81d0c2a0c919a5947c4a5939edd1bb0afc4e873bac82
4
+ data.tar.gz: f1076092210ee338b5a6bdc764b7af0b917c41a0a4389cfd5a5912b8b3ad9317
5
5
  SHA512:
6
- metadata.gz: 3ebb6b641937dc02641948d780a63a6e4bbd62537883eee58f98d09e3e329ea4d19a5fb77e70a36eb0110c70b2d5e652d56effee3528ccd476fa57190f9b5a83
7
- data.tar.gz: 839c8439546cffd2efba661f119b1fbdbff1c834944296cdaea6ce12b3427adfccdf37c6c591cc65f5c245fd465e004dd6e578069c281bb90453c7733cacb4e1
6
+ metadata.gz: 591427e0bc9e78d9188c852cb9e7861e99cbd50e2172bb3617410762f9b4a504fc6efe07ae909591a90a740d1ba91841d557df40d521f5fae6a422f7bd5e7981
7
+ data.tar.gz: 30e6bc7c85b75ab71fe60ed1265492368c09d2535d3c3ecb3d5797013ebd7f34c18527791a0d24fb39cd08d4baedd2821b690104cf2830af632d33faeb49b3d9
@@ -1,7 +1,7 @@
1
1
  class Manage::ApplicationController < ApplicationController
2
2
  before_action :logged_in
3
3
  before_action :require_admin_or_limited_admin
4
- before_action :limit_admin_access, only: ["edit", "update", "new", "create", "destroy", "convert_to_admin", "deliver", "merge", "perform_merge", "toggle_bus_captain", "duplicate", "update_acc_status", "send_update_email", "live_preview"]
4
+ before_action :limit_write_access_to_admins, only: ["edit", "update", "new", "create", "destroy", "convert_to_admin", "deliver", "merge", "perform_merge", "toggle_bus_captain", "duplicate", "update_acc_status", "send_update_email", "live_preview"]
5
5
  skip_before_action :verify_authenticity_token, if: :json_request?
6
6
 
7
7
  def logged_in
@@ -12,7 +12,11 @@ class Manage::ApplicationController < ApplicationController
12
12
  return redirect_to root_path unless current_user.try(:admin?) || current_user.try(:admin_limited_access?)
13
13
  end
14
14
 
15
- def limit_admin_access
15
+ def require_admin_or_limited_admin_or_event_tracking
16
+ redirect_to root_path unless current_user.try(:admin?) || current_user.try(:admin_limited_access?) || current_user.try(:event_tracking?)
17
+ end
18
+
19
+ def limit_write_access_to_admins
16
20
  redirect_to url_for(controller: controller_name, action: :index) unless current_user.try(:admin?)
17
21
  end
18
22
 
@@ -1,4 +1,7 @@
1
1
  class Manage::DashboardController < Manage::ApplicationController
2
+ skip_before_action :require_admin_or_limited_admin
3
+ before_action :require_admin_or_limited_admin_or_event_tracking
4
+
2
5
  def index
3
6
  end
4
7
 
@@ -1,4 +1,7 @@
1
1
  class Manage::TrackableEventsController < Manage::ApplicationController
2
+ skip_before_action :require_admin_or_limited_admin
3
+ before_action :require_admin_or_limited_admin_or_event_tracking
4
+
2
5
  before_action :set_trackable_event, only: [:show, :edit, :update, :destroy]
3
6
  before_action :scope_limited_admin_access, only: [:edit, :update, :destroy]
4
7
 
@@ -78,13 +81,8 @@ class Manage::TrackableEventsController < Manage::ApplicationController
78
81
  params.require(:trackable_event).permit(:band_id, :trackable_tag_id)
79
82
  end
80
83
 
81
- # Permit everyone but regular users to access this controller
82
- def require_admin_or_limited_admin
83
- redirect_to root_path if current_user.try(:user?)
84
- end
85
-
86
- # Permit limited-access admins (overrides Manage::ApplicationController#limit_admin_access)
87
- def limit_admin_access
84
+ # Permit limited-access admins (overrides Manage::ApplicationController#limit_write_access_to_admins)
85
+ def limit_write_access_to_admins
88
86
  end
89
87
 
90
88
  # If the user isn't a full admin, scope changes only to those they created
@@ -1,4 +1,7 @@
1
1
  class Manage::TrackableTagsController < Manage::ApplicationController
2
+ skip_before_action :require_admin_or_limited_admin
3
+ before_action :require_admin_or_limited_admin_or_event_tracking
4
+
2
5
  before_action :set_trackable_tag, only: [:show, :edit, :update, :destroy]
3
6
 
4
7
  respond_to :html, :json
@@ -1,3 +1,3 @@
1
1
  module HackathonManager
2
- VERSION = '0.13.0'.freeze
2
+ VERSION = '0.13.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hackathon_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Olivera
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-18 00:00:00.000000000 Z
11
+ date: 2019-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails