enju_subject 0.1.1 → 0.2.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +3 -3
- data/app/controllers/classification_types_controller.rb +13 -2
- data/app/controllers/classifications_controller.rb +12 -3
- data/app/controllers/concerns/enju_subject/controller.rb +27 -0
- data/app/controllers/subject_heading_types_controller.rb +13 -2
- data/app/controllers/subject_types_controller.rb +13 -2
- data/app/controllers/subjects_controller.rb +12 -4
- data/app/models/classification.rb +1 -1
- data/app/models/classification_type.rb +0 -1
- data/app/models/concerns/enju_subject/enju_manifestation.rb +37 -0
- data/app/models/subject.rb +1 -1
- data/app/models/subject_heading_type.rb +0 -1
- data/app/models/subject_type.rb +0 -1
- data/app/policies/classification_policy.rb +21 -0
- data/app/policies/classification_type_policy.rb +23 -0
- data/app/policies/subject_heading_type_policy.rb +23 -0
- data/app/policies/subject_policy.rb +21 -0
- data/app/policies/subject_type_policy.rb +21 -0
- data/app/views/classification_types/index.html.erb +4 -4
- data/app/views/classification_types/show.html.erb +2 -2
- data/app/views/classifications/index.html.erb +2 -2
- data/app/views/classifications/show.html.erb +2 -2
- data/app/views/manifestations/_classification_fields.html.erb +5 -0
- data/app/views/manifestations/_subject_facet.html.erb +2 -2
- data/app/views/manifestations/_subject_fields.html.erb +6 -0
- data/app/views/manifestations/_subject_form.html.erb +8 -9
- data/app/views/subject_heading_types/index.html.erb +4 -4
- data/app/views/subject_heading_types/show.html.erb +2 -2
- data/app/views/subject_types/index.html.erb +4 -4
- data/app/views/subject_types/show.html.erb +2 -2
- data/app/views/subjects/index.html.erb +3 -3
- data/app/views/subjects/index.rss.builder +2 -2
- data/app/views/subjects/show.html.erb +3 -3
- data/db/fixtures/subject_types.yml +4 -4
- data/lib/enju_subject/master_model.rb +3 -3
- data/lib/enju_subject/version.rb +1 -1
- data/lib/enju_subject.rb +0 -29
- data/lib/generators/enju_subject/setup/setup_generator.rb +6 -1
- data/lib/generators/enju_subject/setup/templates/db/fixtures/classification_types.yml +6 -0
- data/lib/generators/enju_subject/setup/templates/db/fixtures/subject_heading_types.yml +6 -6
- data/lib/tasks/enju_subject_tasks.rake +1 -1
- data/spec/controllers/classification_types_controller_spec.rb +13 -13
- data/spec/controllers/classifications_controller_spec.rb +9 -9
- data/spec/controllers/subject_heading_types_controller_spec.rb +58 -58
- data/spec/controllers/subject_types_controller_spec.rb +13 -13
- data/spec/controllers/subjects_controller_spec.rb +9 -9
- data/spec/dummy/app/controllers/application_controller.rb +8 -4
- data/spec/dummy/app/models/user.rb +1 -1
- data/spec/dummy/config/application.rb +5 -24
- data/spec/dummy/config/environments/development.rb +25 -14
- data/spec/dummy/config/environments/production.rb +50 -31
- data/spec/dummy/config/environments/test.rb +23 -18
- data/spec/dummy/config/initializers/enju_leaf.rb +1 -0
- data/spec/dummy/db/schema.rb +2 -1
- data/spec/lib/generators/enju_subject/setup/setup_generator_spec.rb +34 -0
- data/spec/support/devise.rb +2 -1
- metadata +95 -20
- data/app/models/enju_subject/ability.rb +0 -58
- data/lib/enju_subject/manifestation.rb +0 -44
- data/spec/dummy/app/models/ability.rb +0 -59
- data/spec/dummy/config/application.yml +0 -38
- data/spec/dummy/config/initializers/assets.rb +0 -12
@@ -1,59 +0,0 @@
|
|
1
|
-
#module EnjuSubject
|
2
|
-
class Ability
|
3
|
-
include CanCan::Ability
|
4
|
-
|
5
|
-
def initialize(user, ip_address = '0.0.0.0')
|
6
|
-
case user.try(:role).try(:name)
|
7
|
-
when 'Administrator'
|
8
|
-
can :manage, [
|
9
|
-
Classification,
|
10
|
-
Subject
|
11
|
-
]
|
12
|
-
if LibraryGroup.site_config.network_access_allowed?(ip_address)
|
13
|
-
can [:read, :create, :update], ClassificationType
|
14
|
-
can [:destroy, :delete], ClassificationType do |classification_type|
|
15
|
-
classification_type.classifications.empty?
|
16
|
-
end
|
17
|
-
can :manage, [
|
18
|
-
Classification,
|
19
|
-
Subject,
|
20
|
-
SubjectHeadingType,
|
21
|
-
SubjectType
|
22
|
-
]
|
23
|
-
else
|
24
|
-
can :read, [
|
25
|
-
ClassificationType,
|
26
|
-
SubjectHeadingType,
|
27
|
-
SubjectType
|
28
|
-
]
|
29
|
-
end
|
30
|
-
can :read, Manifestation
|
31
|
-
when 'Librarian'
|
32
|
-
can :read, [
|
33
|
-
Classification,
|
34
|
-
ClassificationType,
|
35
|
-
Subject,
|
36
|
-
SubjectType,
|
37
|
-
SubjectHeadingType
|
38
|
-
]
|
39
|
-
can :read, Manifestation
|
40
|
-
when 'User'
|
41
|
-
can :read, [
|
42
|
-
Classification,
|
43
|
-
ClassificationType,
|
44
|
-
Subject,
|
45
|
-
SubjectHeadingType
|
46
|
-
]
|
47
|
-
can :read, Manifestation
|
48
|
-
else
|
49
|
-
can :read, [
|
50
|
-
Classification,
|
51
|
-
ClassificationType,
|
52
|
-
Subject,
|
53
|
-
SubjectHeadingType
|
54
|
-
]
|
55
|
-
can :read, Manifestation
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
#end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
defaults: &defaults
|
2
|
-
enju:
|
3
|
-
web_hostname: localhost
|
4
|
-
web_port_number: 3000
|
5
|
-
|
6
|
-
family_name_first: true
|
7
|
-
max_number_of_results: 500
|
8
|
-
write_search_log_to_file: true
|
9
|
-
csv_charset_conversion: true
|
10
|
-
|
11
|
-
# Choose a locale from 'ca', 'de', 'fr', 'jp', 'uk', 'us'
|
12
|
-
#AMAZON_AWS_HOSTNAME = 'ecs.amazonaws.com'
|
13
|
-
amazon:
|
14
|
-
aws_hostname: ecs.amazonaws.jp
|
15
|
-
hostname: www.amazon.co.jp
|
16
|
-
access_key: REPLACE_WITH_YOUR_AMAZON_ACCESS_KEY
|
17
|
-
secret_access_key: REPLACE_WITH_YOUR_AMAZON_SECRET_ACCESS_KEY
|
18
|
-
|
19
|
-
# :google, :amazon
|
20
|
-
book_jacket:
|
21
|
-
source: :google
|
22
|
-
unknown_resource:
|
23
|
-
|
24
|
-
# :mozshot, :simpleapi, :heartrails, :thumbalizr
|
25
|
-
screenshot:
|
26
|
-
generator: :mozshot
|
27
|
-
|
28
|
-
uploaded_file:
|
29
|
-
storage: :local
|
30
|
-
|
31
|
-
development:
|
32
|
-
<<: *defaults
|
33
|
-
|
34
|
-
test:
|
35
|
-
<<: *defaults
|
36
|
-
|
37
|
-
production:
|
38
|
-
<<: *defaults
|
@@ -1,12 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# Version of your assets, change this if you want to expire all your assets.
|
4
|
-
Rails.application.config.assets.version = '1.0'
|
5
|
-
|
6
|
-
# Add additional assets to the asset load path
|
7
|
-
# Rails.application.config.assets.paths << Emoji.images_path
|
8
|
-
|
9
|
-
# Precompile additional assets.
|
10
|
-
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
11
|
-
# Rails.application.config.assets.precompile += %w( search.js )
|
12
|
-
Rails.application.config.assets.precompile += %w( *.png icons/*.png )
|