ddr-core 1.16.0 → 1.17.0

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
  SHA256:
3
- metadata.gz: 2696f109287b267f5ef5792291f3096aa9f61cdd9e08164ab64286c276c783b1
4
- data.tar.gz: 17c0fcc4f2b555fc22279390afac20f48bfb6c12e48bca8ab61b58e2b1cf3f02
3
+ metadata.gz: f687f87d6220d9c5bbf05f5021c077a96b6ba2fd2672ec429d673bc2b20801e1
4
+ data.tar.gz: 87c6578805965d78de9fbb11407ddf46718f91961354e4825e05b8a3d11a1247
5
5
  SHA512:
6
- metadata.gz: e54d34b7d5175bbb53b2e9408650f7ddcdaa79967a2426d1db9b12647e228c8c63543039e2eb476e1cbd397b5cf9a4acdfc79606658e856032d13c879cfd6deb
7
- data.tar.gz: e17c400895abb5cfc29a9160a9df89520714ff9a35652bcc2d54a7b6d43a986447f55ce64dc19efc94354c56c0be137a3416d0d8cad41fdae2628253e61d77ee
6
+ metadata.gz: 716a26ef6830209dceaa685e95ab9b2dd69706b803ac7a2ae3130344bbcfd5320105d0bc66609a6c510128c188fc0b8b3ea52a8b8fd06d3baa72d97d61152bce
7
+ data.tar.gz: 420dfcac9d4b2c589b54d9d9e8b4d77bd68efea03bb4e062626148e266201881150232f3c116a45e3e846f8e42f805e4d6275842f4a6b3df9a968f6f1a995858
@@ -3,7 +3,6 @@ module Ddr
3
3
  class Ability < AbstractAbility
4
4
 
5
5
  self.ability_definitions = [ AliasAbilityDefinitions,
6
- CollectionAbilityDefinitions,
7
6
  ItemAbilityDefinitions,
8
7
  ComponentAbilityDefinitions,
9
8
  AttachmentAbilityDefinitions,
@@ -11,7 +10,6 @@ module Ddr
11
10
  EmbargoAbilityDefinitions,
12
11
  PublicationAbilityDefinitions,
13
12
  LockAbilityDefinitions,
14
- AdminSetAbilityDefinitions,
15
13
  ]
16
14
 
17
15
  end
@@ -19,7 +19,7 @@ module Ddr::Auth
19
19
 
20
20
  attr_reader :auth_context
21
21
 
22
- delegate :anonymous?, :authenticated?, :metadata_manager?,
22
+ delegate :anonymous?, :authenticated?,
23
23
  :user, :groups, :agents, :member_of?,
24
24
  :authorized_to_act_as_superuser?,
25
25
  to: :auth_context
@@ -41,10 +41,6 @@ module Ddr::Auth
41
41
  env && env.key?("warden") && env["warden"].authenticate?(scope: :superuser)
42
42
  end
43
43
 
44
- def metadata_manager?
45
- member_of? Ddr::Auth.metadata_managers_group
46
- end
47
-
48
44
  # Return the user agent for this context.
49
45
  # @return [String] or nil, if auth context is anonymous/
50
46
  def agent
data/lib/ddr/auth.rb CHANGED
@@ -29,10 +29,8 @@ module Ddr
29
29
  autoload :WebAuthContext
30
30
 
31
31
  autoload_under 'ability_definitions' do
32
- autoload :AdminSetAbilityDefinitions
33
32
  autoload :AliasAbilityDefinitions
34
33
  autoload :AttachmentAbilityDefinitions
35
- autoload :CollectionAbilityDefinitions
36
34
  autoload :ComponentAbilityDefinitions
37
35
  autoload :ItemAbilityDefinitions
38
36
  autoload :EmbargoAbilityDefinitions
@@ -45,12 +43,6 @@ module Ddr
45
43
  # Name of group whose members are authorized to act as superuser
46
44
  mattr_accessor :superuser_group
47
45
 
48
- # Name of group whose members are authorized to create Collections
49
- mattr_accessor :collection_creators_group
50
-
51
- # Name of group whose members are authorized to act as a metadata manager
52
- mattr_accessor :metadata_managers_group
53
-
54
46
  # Whether to require Shibboleth authentication
55
47
  mattr_accessor :require_shib_user_authn do
56
48
  false
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ddr-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.0
4
+ version: 1.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Coble
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2022-10-03 00:00:00.000000000 Z
14
+ date: 2022-12-12 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activeresource
@@ -352,10 +352,8 @@ files:
352
352
  - lib/ddr/auth.rb
353
353
  - lib/ddr/auth/ability.rb
354
354
  - lib/ddr/auth/ability_definitions.rb
355
- - lib/ddr/auth/ability_definitions/admin_set_ability_definitions.rb
356
355
  - lib/ddr/auth/ability_definitions/alias_ability_definitions.rb
357
356
  - lib/ddr/auth/ability_definitions/attachment_ability_definitions.rb
358
- - lib/ddr/auth/ability_definitions/collection_ability_definitions.rb
359
357
  - lib/ddr/auth/ability_definitions/component_ability_definitions.rb
360
358
  - lib/ddr/auth/ability_definitions/embargo_ability_definitions.rb
361
359
  - lib/ddr/auth/ability_definitions/item_ability_definitions.rb
@@ -450,7 +448,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
450
448
  - !ruby/object:Gem::Version
451
449
  version: '0'
452
450
  requirements: []
453
- rubygems_version: 3.3.22
451
+ rubygems_version: 3.0.3.1
454
452
  signing_key:
455
453
  specification_version: 4
456
454
  summary: Models used in the Duke Digital Repository
@@ -1,9 +0,0 @@
1
- module Ddr::Auth
2
- class AdminSetAbilityDefinitions < AbilityDefinitions
3
-
4
- def call
5
- can :export, Ddr::AdminSet if metadata_manager?
6
- end
7
-
8
- end
9
- end
@@ -1,28 +0,0 @@
1
- module Ddr
2
- module Auth
3
- class CollectionAbilityDefinitions < AbilityDefinitions
4
-
5
- def call
6
- if member_of? Ddr::Auth.collection_creators_group
7
- can :create, Ddr::Collection
8
- end
9
- can :export, Ddr::Collection do |obj|
10
- has_policy_permission?(obj, Permissions::READ)
11
- end
12
- end
13
-
14
- private
15
-
16
- def policy_permissions(obj)
17
- obj.policy_roles
18
- .select { |r| agents.include?(r.agent) }
19
- .map(&:permissions).flatten.uniq
20
- end
21
-
22
- def has_policy_permission?(obj, perm)
23
- policy_permissions(obj).include?(perm)
24
- end
25
-
26
- end
27
- end
28
- end