blacklight-access_controls 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/blacklight/access_controls/enforcement.rb +1 -1
- data/spec/unit/enforcement_spec.rb +11 -11
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9848df97495a043646fee764f7dda99465041821
|
4
|
+
data.tar.gz: ba6e8f65ea7ed2c7968867b6b6e218b934e73379
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8530328e2494fc97e1646af356c6112437d192c2fcd7e7524cf728dc0442af1501dd06e5719a1a326d9fbc6bf92d74a57c798007418aaa944d229788270643a
|
7
|
+
data.tar.gz: 3979b92c05c708de3f47ab486abdeda3e383ad50369cdb3d04210c69e8bc701d328cc94ec042ecd409b4068828739a21c1d1affccf3f750beece6b552aa9b5a6
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.1
|
@@ -70,7 +70,7 @@ module Blacklight
|
|
70
70
|
# for groups
|
71
71
|
permission_types.map do |type|
|
72
72
|
field = solr_field_for(type, 'group')
|
73
|
-
groups = ability.user_groups
|
73
|
+
groups = ability.user_groups
|
74
74
|
# The parens are required to properly OR the cases together.
|
75
75
|
"({!terms f=#{field}}#{groups.join(',')})"
|
76
76
|
end
|
@@ -47,8 +47,8 @@ describe Blacklight::AccessControls::Enforcement do
|
|
47
47
|
end
|
48
48
|
|
49
49
|
it "searches for my groups" do
|
50
|
-
expect(@solr_parameters[:fq].first).to match(%r{\{!terms f=discover_access_group_ssim\}public,faculty,africana
|
51
|
-
expect(@solr_parameters[:fq].first).to match(%r{\{!terms f=read_access_group_ssim\}public,faculty,africana
|
50
|
+
expect(@solr_parameters[:fq].first).to match(%r{\{!terms f=discover_access_group_ssim\}public,faculty,africana-faculty,registered})
|
51
|
+
expect(@solr_parameters[:fq].first).to match(%r{\{!terms f=read_access_group_ssim\}public,faculty,africana-faculty,registered})
|
52
52
|
end
|
53
53
|
|
54
54
|
it "searches for my user key" do
|
@@ -106,27 +106,27 @@ describe Blacklight::AccessControls::Enforcement do
|
|
106
106
|
context 'slashes in the group names' do
|
107
107
|
let(:groups) { ["abc/123","cde/567"] }
|
108
108
|
|
109
|
-
it "
|
110
|
-
expect(@solr_parameters[:fq].first).to match(%r{\{!terms f=discover_access_group_ssim\}public,abc
|
111
|
-
expect(@solr_parameters[:fq].first).to match(%r{\{!terms f=read_access_group_ssim\}public,abc
|
109
|
+
it "doesn't escape slashes" do
|
110
|
+
expect(@solr_parameters[:fq].first).to match(%r{\{!terms f=discover_access_group_ssim\}public,abc/123,cde/567,registered})
|
111
|
+
expect(@solr_parameters[:fq].first).to match(%r{\{!terms f=read_access_group_ssim\}public,abc/123,cde/567,registered})
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
115
115
|
context 'spaces in the group names' do
|
116
116
|
let(:groups) { ["abc 123","cd/e 567"] }
|
117
117
|
|
118
|
-
it "
|
119
|
-
expect(@solr_parameters[:fq].first).to match(%r{\{!terms f=discover_access_group_ssim\}public,abc
|
120
|
-
expect(@solr_parameters[:fq].first).to match(%r{\{!terms f=read_access_group_ssim\}public,abc
|
118
|
+
it "doesn't escape spaces in group names" do
|
119
|
+
expect(@solr_parameters[:fq].first).to match(%r{\{!terms f=discover_access_group_ssim\}public,abc 123,cd/e 567,registered})
|
120
|
+
expect(@solr_parameters[:fq].first).to match(%r{\{!terms f=read_access_group_ssim\}public,abc 123,cd/e 567,registered})
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
124
124
|
context 'colons in the groups names' do
|
125
125
|
let(:groups) { ["abc:123","cde:567"] }
|
126
126
|
|
127
|
-
it "
|
128
|
-
expect(@solr_parameters[:fq].first).to match(%r{\{!terms f=discover_access_group_ssim\}public,abc
|
129
|
-
expect(@solr_parameters[:fq].first).to match(%r{\{!terms f=read_access_group_ssim\}public,abc
|
127
|
+
it "doesn't escape colons" do
|
128
|
+
expect(@solr_parameters[:fq].first).to match(%r{\{!terms f=discover_access_group_ssim\}public,abc:123,cde:567,registered})
|
129
|
+
expect(@solr_parameters[:fq].first).to match(%r{\{!terms f=read_access_group_ssim\}public,abc:123,cde:567,registered})
|
130
130
|
end
|
131
131
|
end
|
132
132
|
end
|