glib-web 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/concerns/glib/auth/policy.rb +5 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36ac8042a2934608affdfa3ac546ca2efd6caff2f03eb2a1a02d7c9e3c145443
|
4
|
+
data.tar.gz: dbeaafdbf9ae36aeb6419cdba60c7676489eef6830076d8a9c84cdb26c98ef12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b528ad5eeb7613ae09e83f31e74951b7b40e64424e5086d75022039f66dc0a44624e4dc9818eddd7a205afe97d74ba298a4072ae0a568ea5b29f8ae28245c0f
|
7
|
+
data.tar.gz: eda842d4c68a7c74b9d3d59c663c4725eae8c7342b5dc9f7bdacbb9769b26850ce7a6f8739316047265c031d8936ce2edc98887619e2c9c9475ab42876b90edb
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'pundit'
|
2
|
+
|
1
3
|
module Glib::Auth
|
2
4
|
module Policy
|
3
5
|
extend ActiveSupport::Concern
|
@@ -6,7 +8,7 @@ module Glib::Auth
|
|
6
8
|
include Pundit
|
7
9
|
include Overrides
|
8
10
|
extend ClassMethods
|
9
|
-
|
11
|
+
|
10
12
|
# TODO: Ultimately we want to uncomment this line, but:
|
11
13
|
# - Need to be able to set aside some time to run rspec tests to ensure nothing gets broken
|
12
14
|
# - Need to find a solution where we can reuse a single public policy
|
@@ -53,7 +55,7 @@ module Glib::Auth
|
|
53
55
|
end
|
54
56
|
|
55
57
|
|
56
|
-
|
58
|
+
|
57
59
|
module ClassMethods
|
58
60
|
# Inspired from https://github.com/ryanb/cancan/wiki/Non-RESTful-Controllers
|
59
61
|
public
|
@@ -63,7 +65,7 @@ module Glib::Auth
|
|
63
65
|
|
64
66
|
self.before_action(options.slice(:only, :except, :if, :unless)) do |controller|
|
65
67
|
resource_name ||= resource_name_from_controller
|
66
|
-
|
68
|
+
|
67
69
|
if !(resource_key = options[:class]).nil?
|
68
70
|
resource = case resource_key
|
69
71
|
when false
|