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 +4 -4
- data/app/controllers/manage/application_controller.rb +6 -2
- data/app/controllers/manage/dashboard_controller.rb +3 -0
- data/app/controllers/manage/trackable_events_controller.rb +5 -7
- data/app/controllers/manage/trackable_tags_controller.rb +3 -0
- data/lib/hackathon_manager/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edbee88bd48b0012031f81d0c2a0c919a5947c4a5939edd1bb0afc4e873bac82
|
4
|
+
data.tar.gz: f1076092210ee338b5a6bdc764b7af0b917c41a0a4389cfd5a5912b8b3ad9317
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 :
|
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
|
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::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
|
82
|
-
def
|
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
|
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.
|
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-
|
11
|
+
date: 2019-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|