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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d9f4e9a294e4eb06926d2cda789c8b1feb24609
4
- data.tar.gz: 84ea038cc5f00777a46865971fab5ef1fc363bd3
3
+ metadata.gz: bf2489122e87b5314a540070ce5a299a8832ba9b
4
+ data.tar.gz: a66a5afa2fd33ab7df17f4e5a18d595c88f9f3fc
5
5
  SHA512:
6
- metadata.gz: c061f202f781cd99fdfae4ffc0910bd66e9d49d50052cd87ea77a5b8f7ec44a21271769b22f66ee0a34d37c5277c28f776730013510b91a4d4be3492bc052045
7
- data.tar.gz: 21c4e5e27a1b6b1b516bc50906d76821eb8388892a114b9aea06ab34d77ea965cf7576a3fc51c7f7a6862f0e1cb739a92009e5eee5169c45e3761b3f5bdae5b0
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.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.1
239
+ rubygems_version: 2.5.2
240
240
  signing_key:
241
241
  specification_version: 4
242
242
  summary: Access controls for project hydra