hydra-access-controls 10.3.3 → 10.3.4
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/models/hydra/access_controls/permission.rb +5 -1
- data/spec/unit/permission_spec.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf2489122e87b5314a540070ce5a299a8832ba9b
|
4
|
+
data.tar.gz: a66a5afa2fd33ab7df17f4e5a18d595c88f9f3fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8b2e99f21ae1592a5e7bf0fc70e927147071fcf880783a5fc6441052e64f800d066ccaf14984fea765edffdd162ffab61f50a65c35717e45ba1d8e616a4d061
|
7
|
+
data.tar.gz: 516a0af52de9ede95d7e908751dc002ba50d516569248ec1165ddeb10841a229e9387c6f41de9f9d0f0f0eefac5225c8cd77bc3d8a65d1bc6acab1cf1fe005e6
|
@@ -5,9 +5,13 @@ module Hydra::AccessControls
|
|
5
5
|
class Permission < AccessControlList
|
6
6
|
has_many :admin_policies, inverse_of: :default_permissions, class_name: 'Hydra::AdminPolicy'
|
7
7
|
|
8
|
+
# @param [Hash] args
|
9
|
+
# @option args [#to_s] :name name of agent
|
10
|
+
# @option args [#to_s] :type type of agent: group/person
|
11
|
+
# @option args [String] :access description of access: read/edit/discover
|
8
12
|
def initialize(args)
|
9
13
|
super()
|
10
|
-
build_agent(args[:name], args[:type].to_s)
|
14
|
+
build_agent(args[:name].to_s, args[:type].to_s)
|
11
15
|
build_access(args[:access])
|
12
16
|
end
|
13
17
|
|
@@ -59,5 +59,14 @@ describe Hydra::AccessControls::Permission do
|
|
59
59
|
expect(permission.agent_name).to eq 'john doe'
|
60
60
|
expect(permission2.agent_name).to eq 'hydra devs'
|
61
61
|
end
|
62
|
+
|
63
|
+
context 'with a User instance passed as :name argument' do
|
64
|
+
let(:permission) { described_class.new(type: 'person', name: user, access: 'read') }
|
65
|
+
let(:user) { FactoryGirl.create(:archivist) }
|
66
|
+
|
67
|
+
it "should use string and escape agent when building" do
|
68
|
+
expect(permission.agent.first.rdf_subject.to_s).to eq 'http://projecthydra.org/ns/auth/person#archivist1@example.com'
|
69
|
+
end
|
70
|
+
end
|
62
71
|
end
|
63
72
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hydra-access-controls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 10.3.
|
4
|
+
version: 10.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beer
|
@@ -236,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
236
236
|
version: '0'
|
237
237
|
requirements: []
|
238
238
|
rubyforge_project:
|
239
|
-
rubygems_version: 2.5.
|
239
|
+
rubygems_version: 2.5.2
|
240
240
|
signing_key:
|
241
241
|
specification_version: 4
|
242
242
|
summary: Access controls for project hydra
|