sufia 3.3.1 → 3.4.0.rc1
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 +5 -13
- data/History.md +6 -2
- data/SUFIA_VERSION +1 -1
- data/{lib → app/controllers/concerns}/sufia/contact_form_controller_behavior.rb +0 -0
- data/{lib → app/controllers/concerns}/sufia/dashboard_controller_behavior.rb +0 -0
- data/lib/sufia.rb +2 -2
- data/lib/sufia/version.rb +1 -1
- data/spec/controllers/batch_edits_controller_spec.rb +2 -2
- data/spec/controllers/downloads_controller_spec.rb +4 -4
- data/spec/controllers/single_use_links_viewer_controller_spec.rb +1 -1
- data/spec/features/single_use_links_spec.rb +1 -1
- data/spec/models/generic_file/visibility_spec.rb +1 -1
- data/sufia-models/app/models/batch.rb +5 -6
- data/sufia-models/lib/sufia/models/generic_file.rb +3 -4
- data/sufia-models/lib/sufia/models/generic_file/characterization.rb +2 -2
- data/sufia-models/lib/sufia/models/generic_file/permissions.rb +9 -4
- data/sufia-models/lib/sufia/models/version.rb +1 -1
- data/sufia-models/sufia-models.gemspec +6 -2
- data/sufia.gemspec +1 -3
- metadata +22 -50
- data/sufia-models/lib/sufia/models/generic_file/visibility.rb +0 -65
checksums.yaml
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
|
|
5
|
-
data.tar.gz: !binary |-
|
|
6
|
-
Y2MzMjMzMjI1MzdiMGFlN2YwYjcwNWQzZTBmZTRlMzBjMjZmODBmMA==
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 9e8b880c78652a7107ed7c477a2fd60ac2a18d9b
|
|
4
|
+
data.tar.gz: f398c4358574df797fcaac72f0ba960c89f5cceb
|
|
7
5
|
SHA512:
|
|
8
|
-
metadata.gz:
|
|
9
|
-
|
|
10
|
-
ZWZiOGFmN2YwMjEyNjhiN2FhNWJiZDdkNGRkNTY0ZmM2YzE1YWMzM2E3ZDBk
|
|
11
|
-
MTRhMWNjYTczNTkzMjNmODY3MzJjNDIyN2Y0MTZkMWRmYTMwMTc=
|
|
12
|
-
data.tar.gz: !binary |-
|
|
13
|
-
NzZhNWQzMGMxN2M1ZGQyNjJiNjkxNmExNDRkYzY4NDU4NWE1YzdjMDhiYmU1
|
|
14
|
-
MjNjNTJmYTgzOTQ0NzFlNjg2OTgwNGY3Yjc5NzkyMmI3ODViZjU2MzdiNWFh
|
|
15
|
-
Nzk1MjBlYzJjYWFiODM4OGIxNjViM2ZlNmQ3ZmU1OWJmNjBkYjk=
|
|
6
|
+
metadata.gz: 8f053ac8dcd4692883e481ee0645f72e3f58b0fba80cfb7f12d03b3428e0bf84fa81a5ca80cafba91c73773a37e59e258620fd6bb3b7d0761fb00cf0774df2ca
|
|
7
|
+
data.tar.gz: 21ea3febe2601469eddf35eb786ab2848f2de7bb2a881153e1655d976242bf4ee9bbad12c4b7253f566217743d15af21b7b2996678d99f701ed183f7a9f4f257
|
data/History.md
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
# History of Sufia releases
|
|
2
2
|
|
|
3
|
-
## 3.
|
|
4
|
-
*
|
|
3
|
+
## 3.4.0.rc1
|
|
4
|
+
* 2013-10-01: Remove Visibility, which was moved into hydra-head [Justin Coyne]
|
|
5
|
+
* 2013-10-01: Fix deprecation warnings by switching to
|
|
6
|
+
Hydra::AccessControls::Permissions [Justin Coyne]
|
|
7
|
+
* 2013-09-27: Works with hydra 6.1.0.rc1 [Justin Coyne]
|
|
8
|
+
|
|
5
9
|
|
|
6
10
|
## 3.3.0
|
|
7
11
|
* Fix authorities deprecations [Justin Coyne]
|
data/SUFIA_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.4.0.rc1
|
|
File without changes
|
|
File without changes
|
data/lib/sufia.rb
CHANGED
|
@@ -6,8 +6,6 @@ require 'hydra-batch-edit'
|
|
|
6
6
|
require 'sufia/models'
|
|
7
7
|
|
|
8
8
|
require 'rails_autolink'
|
|
9
|
-
require 'sufia/dashboard_controller_behavior'
|
|
10
|
-
require "sufia/contact_form_controller_behavior"
|
|
11
9
|
|
|
12
10
|
autoload :Zip, 'zipruby'
|
|
13
11
|
module Sufia
|
|
@@ -20,7 +18,9 @@ module Sufia
|
|
|
20
18
|
#{config.root}/app/controllers/concerns
|
|
21
19
|
#{config.root}/app/models/concerns
|
|
22
20
|
#{config.root}/app/models/datastreams
|
|
21
|
+
#{Hydra::Engine.root}/app/models/concerns
|
|
23
22
|
)
|
|
23
|
+
puts "concern #{Hydra::Engine.root}/app/models/concerns"
|
|
24
24
|
|
|
25
25
|
end
|
|
26
26
|
|
data/lib/sufia/version.rb
CHANGED
|
@@ -8,10 +8,10 @@ describe BatchEditsController do
|
|
|
8
8
|
User.any_instance.stub(:groups).and_return([])
|
|
9
9
|
controller.stub(:clear_session_user) ## Don't clear out the authenticated session
|
|
10
10
|
request.env["HTTP_REFERER"] = 'test.host/original_page'
|
|
11
|
-
@routes = Internal::Application.routes
|
|
12
|
-
|
|
13
11
|
end
|
|
14
12
|
|
|
13
|
+
routes { Internal::Application.routes }
|
|
14
|
+
|
|
15
15
|
describe "edit" do
|
|
16
16
|
before do
|
|
17
17
|
@one = GenericFile.new(:creator=>"Fred", :language=>'en')
|
|
@@ -29,7 +29,7 @@ describe DownloadsController do
|
|
|
29
29
|
it "should default to returning configured default download" do
|
|
30
30
|
DownloadsController.default_content_dsid.should == "content"
|
|
31
31
|
controller.stub(:render) # send_data calls render internally
|
|
32
|
-
expected_content = ActiveFedora::Base.find("sufia:test1").content.content
|
|
32
|
+
expected_content = ActiveFedora::Base.find("sufia:test1", cast: true).content.content
|
|
33
33
|
controller.should_receive(:send_file_headers!).with({:filename => 'world.png', :disposition => 'inline', :type => 'image/png' })
|
|
34
34
|
get "show", :id => "test1"
|
|
35
35
|
response.body.should == expected_content
|
|
@@ -37,7 +37,7 @@ describe DownloadsController do
|
|
|
37
37
|
end
|
|
38
38
|
it "should return requested datastreams" do
|
|
39
39
|
controller.stub(:render) # send_data calls render internally
|
|
40
|
-
expected_content = ActiveFedora::Base.find("sufia:test1").descMetadata.content
|
|
40
|
+
expected_content = ActiveFedora::Base.find("sufia:test1", cast: true).descMetadata.content
|
|
41
41
|
controller.should_receive(:send_file_headers!).with({:filename => 'descMetadata', :disposition => 'inline', :type => 'text/plain' })
|
|
42
42
|
get "show", :id => "test1", :datastream_id => "descMetadata"
|
|
43
43
|
response.body.should == expected_content
|
|
@@ -45,7 +45,7 @@ describe DownloadsController do
|
|
|
45
45
|
end
|
|
46
46
|
it "should support setting disposition to inline" do
|
|
47
47
|
controller.stub(:render) # send_data calls render internally
|
|
48
|
-
expected_content = ActiveFedora::Base.find("sufia:test1").content.content
|
|
48
|
+
expected_content = ActiveFedora::Base.find("sufia:test1", cast: true).content.content
|
|
49
49
|
controller.should_receive(:send_file_headers!).with({:filename => 'world.png', :disposition => 'inline', :type => 'image/png' })
|
|
50
50
|
get "show", :id => "test1", :disposition => "inline"
|
|
51
51
|
response.body.should == expected_content
|
|
@@ -54,7 +54,7 @@ describe DownloadsController do
|
|
|
54
54
|
|
|
55
55
|
it "should allow you to specify filename for download" do
|
|
56
56
|
controller.stub(:render) # send_data calls render internally
|
|
57
|
-
expected_content = ActiveFedora::Base.find("sufia:test1").content.content
|
|
57
|
+
expected_content = ActiveFedora::Base.find("sufia:test1", cast: true).content.content
|
|
58
58
|
controller.should_receive(:send_file_headers!).with({:filename => 'my%20dog.png', :disposition => 'inline', :type => 'image/png' })
|
|
59
59
|
get "show", :id => "test1", "filename" => "my%20dog.png"
|
|
60
60
|
response.body.should == expected_content
|
|
@@ -45,7 +45,7 @@ describe SingleUseLinksViewerController do
|
|
|
45
45
|
describe "GET 'download'" do
|
|
46
46
|
it "and_return http success" do
|
|
47
47
|
controller.stub(:render)
|
|
48
|
-
expected_content = ActiveFedora::Base.find(@file.pid).content.content
|
|
48
|
+
expected_content = ActiveFedora::Base.find(@file.pid, cast: true).content.content
|
|
49
49
|
controller.should_receive(:send_file_headers!).with({:filename => 'world.png', :disposition => 'inline', :type => 'image/png' })
|
|
50
50
|
get :download, id:download_link_hash
|
|
51
51
|
response.body.should == expected_content
|
|
@@ -32,7 +32,7 @@ describe "Create and use single-use links" do
|
|
|
32
32
|
|
|
33
33
|
expect(page).to have_css '.download-link'
|
|
34
34
|
find('.download-link').click
|
|
35
|
-
expected_content = ActiveFedora::Base.find(@file.pid).content.content
|
|
35
|
+
expected_content = ActiveFedora::Base.find(@file.pid, cast: true).content.content
|
|
36
36
|
expect(page.body).to eq expected_content
|
|
37
37
|
end
|
|
38
38
|
end
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
class Batch < ActiveFedora::Base
|
|
2
|
-
include Hydra::
|
|
3
|
-
include Hydra::ModelMixins::RightsMetadata
|
|
2
|
+
include Hydra::AccessControls::Permissions
|
|
4
3
|
include Sufia::ModelMethods
|
|
5
4
|
include Sufia::Noid
|
|
6
5
|
|
|
@@ -9,10 +8,10 @@ class Batch < ActiveFedora::Base
|
|
|
9
8
|
belongs_to :user, :property => "creator"
|
|
10
9
|
has_many :generic_files, :property => :is_part_of
|
|
11
10
|
|
|
12
|
-
delegate :title, :to => :descMetadata
|
|
13
|
-
delegate :creator, :to => :descMetadata
|
|
14
|
-
delegate :part, :to => :descMetadata
|
|
15
|
-
delegate :status, :to => :descMetadata
|
|
11
|
+
delegate :title, :to => :descMetadata, multiple: true
|
|
12
|
+
delegate :creator, :to => :descMetadata, multiple: true
|
|
13
|
+
delegate :part, :to => :descMetadata, multiple: true
|
|
14
|
+
delegate :status, :to => :descMetadata, multiple: true
|
|
16
15
|
|
|
17
16
|
def self.find_or_create(pid)
|
|
18
17
|
begin
|
|
@@ -4,7 +4,6 @@ module Sufia
|
|
|
4
4
|
extend ActiveSupport::Autoload
|
|
5
5
|
autoload :Actions, 'sufia/models/generic_file/actions'
|
|
6
6
|
autoload :Permissions, 'sufia/models/generic_file/permissions'
|
|
7
|
-
autoload :Visibility, 'sufia/models/generic_file/visibility'
|
|
8
7
|
autoload :WebForm, 'sufia/models/generic_file/web_form'
|
|
9
8
|
autoload :AccessibleAttributes, 'sufia/models/generic_file/accessible_attributes'
|
|
10
9
|
include Sufia::ModelMethods
|
|
@@ -26,12 +25,12 @@ module Sufia
|
|
|
26
25
|
|
|
27
26
|
belongs_to :batch, :property => :is_part_of
|
|
28
27
|
|
|
29
|
-
delegate_to :properties, [:relative_path, :depositor, :import_url], :
|
|
30
|
-
delegate_to :descMetadata, [:date_uploaded, :date_modified], :
|
|
28
|
+
delegate_to :properties, [:relative_path, :depositor, :import_url], multiple: false
|
|
29
|
+
delegate_to :descMetadata, [:date_uploaded, :date_modified], multiple: false
|
|
31
30
|
delegate_to :descMetadata, [:related_url, :based_near, :part_of, :creator,
|
|
32
31
|
:contributor, :title, :tag, :description, :rights,
|
|
33
32
|
:publisher, :date_created, :subject,
|
|
34
|
-
:resource_type, :identifier, :language]
|
|
33
|
+
:resource_type, :identifier, :language], multiple: true
|
|
35
34
|
|
|
36
35
|
around_save :characterize_if_changed, :retry_warming
|
|
37
36
|
before_destroy :cleanup_trophies
|
|
@@ -4,7 +4,7 @@ module Sufia
|
|
|
4
4
|
extend ActiveSupport::Concern
|
|
5
5
|
included do
|
|
6
6
|
has_metadata :name => "characterization", :type => FitsDatastream
|
|
7
|
-
delegate :mime_type, :to => :characterization, :
|
|
7
|
+
delegate :mime_type, :to => :characterization, multiple: false
|
|
8
8
|
delegate_to :characterization, [:format_label, :file_size, :last_modified,
|
|
9
9
|
:filename, :original_checksum, :rights_basis,
|
|
10
10
|
:copyright_basis, :copyright_note,
|
|
@@ -20,7 +20,7 @@ module Sufia
|
|
|
20
20
|
:gps_timestamp, :latitude, :longitude,
|
|
21
21
|
:character_set, :markup_basis,
|
|
22
22
|
:markup_language, :duration, :bit_depth,
|
|
23
|
-
:sample_rate, :channels, :data_format, :offset]
|
|
23
|
+
:sample_rate, :channels, :data_format, :offset], multiple: true
|
|
24
24
|
|
|
25
25
|
end
|
|
26
26
|
|
|
@@ -2,12 +2,12 @@ module Sufia
|
|
|
2
2
|
module GenericFile
|
|
3
3
|
module Permissions
|
|
4
4
|
extend ActiveSupport::Concern
|
|
5
|
-
#we're overriding the permissions= method which is in
|
|
6
|
-
include Hydra::
|
|
7
|
-
include
|
|
5
|
+
#we're overriding the permissions= method which is in Hydra::AccessControls::Permissions
|
|
6
|
+
include Hydra::AccessControls::Permissions
|
|
7
|
+
include Hydra::AccessControls::Visibility
|
|
8
8
|
|
|
9
9
|
included do
|
|
10
|
-
has_metadata
|
|
10
|
+
has_metadata "rightsMetadata", :type => ParanoidRightsDatastream
|
|
11
11
|
validate :paranoid_permissions
|
|
12
12
|
end
|
|
13
13
|
|
|
@@ -29,6 +29,11 @@ module Sufia
|
|
|
29
29
|
rightsMetadata.update_permissions(perm_hash)
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
+
def permissions
|
|
33
|
+
perms = super
|
|
34
|
+
perms.map {|p| { name: p.name, access: p.access, type:p.type } }
|
|
35
|
+
end
|
|
36
|
+
|
|
32
37
|
private
|
|
33
38
|
|
|
34
39
|
def permission_hash
|
|
@@ -29,8 +29,12 @@ Gem::Specification.new do |spec|
|
|
|
29
29
|
|
|
30
30
|
spec.add_dependency 'rails', '>= 3.2.13', '< 5.0'
|
|
31
31
|
spec.add_dependency 'activeresource' # No longer a dependency of rails 4.0
|
|
32
|
-
|
|
33
|
-
spec.add_dependency
|
|
32
|
+
|
|
33
|
+
# spec.add_dependency "hydra", "6.1.0.rc1"
|
|
34
|
+
# Since hydra 6.1 isn't out yet, we'll just build it so that it's compatible
|
|
35
|
+
# without an explicit dependency
|
|
36
|
+
spec.add_dependency "hydra-head", "~> 6.4.0.rc1"
|
|
37
|
+
spec.add_dependency 'active-fedora', "~> 6.6.0.rc1"
|
|
34
38
|
|
|
35
39
|
spec.add_dependency 'nest', '~> 1.1.1'
|
|
36
40
|
spec.add_dependency 'resque', '~> 1.23.0'#, :require => 'resque/server'
|
data/sufia.gemspec
CHANGED
|
@@ -18,11 +18,9 @@ Gem::Specification.new do |gem|
|
|
|
18
18
|
gem.license = 'APACHE2'
|
|
19
19
|
|
|
20
20
|
gem.add_dependency 'sufia-models', version
|
|
21
|
-
gem.add_dependency 'blacklight', '~> 4.0', '< 4.4' # blacklight 4.4.1/0 doesn't work with kaminari > 0.14.1
|
|
22
21
|
gem.add_dependency 'blacklight_advanced_search', '~> 2.1.0'
|
|
23
22
|
|
|
24
|
-
gem.add_dependency 'hydra-batch-edit', '
|
|
25
|
-
gem.add_dependency 'hydra-collections', '~> 1.0.0'
|
|
23
|
+
gem.add_dependency 'hydra-batch-edit', '>= 1.1.1', '< 2.0.0'
|
|
26
24
|
|
|
27
25
|
gem.add_dependency 'daemons', '1.1.9'
|
|
28
26
|
gem.add_dependency 'mail_form'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sufia
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.4.0.rc1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Justin Coyne
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-10-
|
|
11
|
+
date: 2013-10-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: sufia-models
|
|
@@ -16,34 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - '='
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 3.
|
|
19
|
+
version: 3.4.0.rc1
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - '='
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 3.
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: blacklight
|
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
|
30
|
-
requirements:
|
|
31
|
-
- - ~>
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: '4.0'
|
|
34
|
-
- - <
|
|
35
|
-
- !ruby/object:Gem::Version
|
|
36
|
-
version: '4.4'
|
|
37
|
-
type: :runtime
|
|
38
|
-
prerelease: false
|
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
40
|
-
requirements:
|
|
41
|
-
- - ~>
|
|
42
|
-
- !ruby/object:Gem::Version
|
|
43
|
-
version: '4.0'
|
|
44
|
-
- - <
|
|
45
|
-
- !ruby/object:Gem::Version
|
|
46
|
-
version: '4.4'
|
|
26
|
+
version: 3.4.0.rc1
|
|
47
27
|
- !ruby/object:Gem::Dependency
|
|
48
28
|
name: blacklight_advanced_search
|
|
49
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -62,30 +42,22 @@ dependencies:
|
|
|
62
42
|
name: hydra-batch-edit
|
|
63
43
|
requirement: !ruby/object:Gem::Requirement
|
|
64
44
|
requirements:
|
|
65
|
-
- -
|
|
45
|
+
- - '>='
|
|
66
46
|
- !ruby/object:Gem::Version
|
|
67
|
-
version: 1.
|
|
68
|
-
|
|
69
|
-
prerelease: false
|
|
70
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
71
|
-
requirements:
|
|
72
|
-
- - ~>
|
|
73
|
-
- !ruby/object:Gem::Version
|
|
74
|
-
version: 1.0.2
|
|
75
|
-
- !ruby/object:Gem::Dependency
|
|
76
|
-
name: hydra-collections
|
|
77
|
-
requirement: !ruby/object:Gem::Requirement
|
|
78
|
-
requirements:
|
|
79
|
-
- - ~>
|
|
47
|
+
version: 1.1.1
|
|
48
|
+
- - <
|
|
80
49
|
- !ruby/object:Gem::Version
|
|
81
|
-
version:
|
|
50
|
+
version: 2.0.0
|
|
82
51
|
type: :runtime
|
|
83
52
|
prerelease: false
|
|
84
53
|
version_requirements: !ruby/object:Gem::Requirement
|
|
85
54
|
requirements:
|
|
86
|
-
- -
|
|
55
|
+
- - '>='
|
|
87
56
|
- !ruby/object:Gem::Version
|
|
88
|
-
version: 1.
|
|
57
|
+
version: 1.1.1
|
|
58
|
+
- - <
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: 2.0.0
|
|
89
61
|
- !ruby/object:Gem::Dependency
|
|
90
62
|
name: daemons
|
|
91
63
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -104,14 +76,14 @@ dependencies:
|
|
|
104
76
|
name: mail_form
|
|
105
77
|
requirement: !ruby/object:Gem::Requirement
|
|
106
78
|
requirements:
|
|
107
|
-
- -
|
|
79
|
+
- - '>='
|
|
108
80
|
- !ruby/object:Gem::Version
|
|
109
81
|
version: '0'
|
|
110
82
|
type: :runtime
|
|
111
83
|
prerelease: false
|
|
112
84
|
version_requirements: !ruby/object:Gem::Requirement
|
|
113
85
|
requirements:
|
|
114
|
-
- -
|
|
86
|
+
- - '>='
|
|
115
87
|
- !ruby/object:Gem::Version
|
|
116
88
|
version: '0'
|
|
117
89
|
- !ruby/object:Gem::Dependency
|
|
@@ -280,6 +252,8 @@ files:
|
|
|
280
252
|
- app/controllers/authorities_controller.rb
|
|
281
253
|
- app/controllers/batch_controller.rb
|
|
282
254
|
- app/controllers/batch_edits_controller.rb
|
|
255
|
+
- app/controllers/concerns/sufia/contact_form_controller_behavior.rb
|
|
256
|
+
- app/controllers/concerns/sufia/dashboard_controller_behavior.rb
|
|
283
257
|
- app/controllers/concerns/sufia/users_controller_behavior.rb
|
|
284
258
|
- app/controllers/contact_form_controller.rb
|
|
285
259
|
- app/controllers/dashboard_controller.rb
|
|
@@ -510,9 +484,7 @@ files:
|
|
|
510
484
|
- lib/generators/sufia/templates/migrations/create_version_committers.rb
|
|
511
485
|
- lib/sufia.rb
|
|
512
486
|
- lib/sufia/batch_edits_controller_behavior.rb
|
|
513
|
-
- lib/sufia/contact_form_controller_behavior.rb
|
|
514
487
|
- lib/sufia/controller.rb
|
|
515
|
-
- lib/sufia/dashboard_controller_behavior.rb
|
|
516
488
|
- lib/sufia/downloads_controller_behavior.rb
|
|
517
489
|
- lib/sufia/files_controller/local_ingest_behavior.rb
|
|
518
490
|
- lib/sufia/files_controller/upload_complete_behavior.rb
|
|
@@ -699,7 +671,6 @@ files:
|
|
|
699
671
|
- sufia-models/lib/sufia/models/generic_file/mime_types.rb
|
|
700
672
|
- sufia-models/lib/sufia/models/generic_file/permissions.rb
|
|
701
673
|
- sufia-models/lib/sufia/models/generic_file/thumbnail.rb
|
|
702
|
-
- sufia-models/lib/sufia/models/generic_file/visibility.rb
|
|
703
674
|
- sufia-models/lib/sufia/models/generic_file/web_form.rb
|
|
704
675
|
- sufia-models/lib/sufia/models/id_service.rb
|
|
705
676
|
- sufia-models/lib/sufia/models/jobs/active_fedora_pid_based_job.rb
|
|
@@ -767,17 +738,17 @@ require_paths:
|
|
|
767
738
|
- lib
|
|
768
739
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
769
740
|
requirements:
|
|
770
|
-
- -
|
|
741
|
+
- - '>='
|
|
771
742
|
- !ruby/object:Gem::Version
|
|
772
743
|
version: '0'
|
|
773
744
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
774
745
|
requirements:
|
|
775
|
-
- -
|
|
746
|
+
- - '>'
|
|
776
747
|
- !ruby/object:Gem::Version
|
|
777
|
-
version:
|
|
748
|
+
version: 1.3.1
|
|
778
749
|
requirements: []
|
|
779
750
|
rubyforge_project:
|
|
780
|
-
rubygems_version: 2.
|
|
751
|
+
rubygems_version: 2.0.5
|
|
781
752
|
signing_key:
|
|
782
753
|
specification_version: 4
|
|
783
754
|
summary: Sufia was extracted from ScholarSphere developed by Penn State University
|
|
@@ -891,3 +862,4 @@ test_files:
|
|
|
891
862
|
- spec/support/lib/generators/test_app_generator.rb
|
|
892
863
|
- spec/support/uploaded_file_monkeypatch.rb
|
|
893
864
|
- spec/views/batch_edits/check_all_spec.rb
|
|
865
|
+
has_rdoc:
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
module Sufia
|
|
2
|
-
module GenericFile
|
|
3
|
-
module Visibility
|
|
4
|
-
extend ActiveSupport::Concern
|
|
5
|
-
extend Deprecation
|
|
6
|
-
|
|
7
|
-
def visibility=(value)
|
|
8
|
-
return if value.nil?
|
|
9
|
-
# only set explicit permissions
|
|
10
|
-
case value
|
|
11
|
-
when Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
|
|
12
|
-
public_visibility!
|
|
13
|
-
when Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED
|
|
14
|
-
registered_visibility!
|
|
15
|
-
when Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE
|
|
16
|
-
private_visibility!
|
|
17
|
-
else
|
|
18
|
-
raise ArgumentError, "Invalid visibility: #{value.inspect}"
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def visibility
|
|
23
|
-
if read_groups.include? Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_PUBLIC
|
|
24
|
-
Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
|
|
25
|
-
elsif read_groups.include? Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_AUTHENTICATED
|
|
26
|
-
Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED
|
|
27
|
-
else
|
|
28
|
-
Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def set_visibility(visibility)
|
|
33
|
-
Deprecation.warn Visibility, "set_visibility is deprecated, use visibility= instead. set_visibility will be removed in sufia 3.0", caller
|
|
34
|
-
self.visibility= visibility
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
def visibility_changed?
|
|
38
|
-
@visibility_will_change
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
private
|
|
42
|
-
def visibility_will_change!
|
|
43
|
-
@visibility_will_change = true
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def public_visibility!
|
|
47
|
-
visibility_will_change! unless visibility == Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
|
|
48
|
-
self.datastreams["rightsMetadata"].permissions({:group=>Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_PUBLIC}, "read")
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
def registered_visibility!
|
|
52
|
-
visibility_will_change! unless visibility == Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED
|
|
53
|
-
self.datastreams["rightsMetadata"].permissions({:group=>Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_AUTHENTICATED}, "read")
|
|
54
|
-
self.datastreams["rightsMetadata"].permissions({:group=>Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_PUBLIC}, "none")
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
def private_visibility!
|
|
58
|
-
visibility_will_change! unless visibility == Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE
|
|
59
|
-
self.datastreams["rightsMetadata"].permissions({:group=>Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_AUTHENTICATED}, "none")
|
|
60
|
-
self.datastreams["rightsMetadata"].permissions({:group=>Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_PUBLIC}, "none")
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
end
|