enju_circulation 0.1.0.pre14 → 0.1.0.pre15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/enju_circulation/ability.rb +10 -10
- data/app/views/checkout_types/index.html.erb +1 -1
- data/app/views/checkouts/_list.html.erb +1 -1
- data/app/views/checkouts/show.html.erb +1 -1
- data/app/views/circulation_statuses/index.html.erb +1 -1
- data/app/views/reserves/index.html.erb +1 -1
- data/app/views/use_restrictions/index.html.erb +1 -1
- data/lib/enju_circulation/user.rb +1 -1
- data/lib/enju_circulation/version.rb +1 -1
- data/spec/dummy/app/models/ability.rb +10 -10
- data/spec/dummy/app/models/user.rb +1 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/solr/data/test/index/{_ub.fdt → _wh.fdt} +0 -0
- data/spec/dummy/solr/data/test/index/{_ub.fdx → _wh.fdx} +0 -0
- data/spec/dummy/solr/data/test/index/{_ub.fnm → _wh.fnm} +0 -0
- data/spec/dummy/solr/data/test/index/{_ub.frq → _wh.frq} +0 -0
- data/spec/dummy/solr/data/test/index/{_ub.nrm → _wh.nrm} +0 -0
- data/spec/dummy/solr/data/test/index/{_ub.prx → _wh.prx} +0 -0
- data/spec/dummy/solr/data/test/index/{_ub.tii → _wh.tii} +0 -0
- data/spec/dummy/solr/data/test/index/{_ub.tis → _wh.tis} +0 -0
- data/spec/dummy/solr/data/test/index/segments.gen +0 -0
- data/spec/dummy/solr/data/test/index/{segments_1op → segments_1t1} +0 -0
- metadata +27 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9298b4e2ef205c74dd31f6f2f18521a658668dbb
|
4
|
+
data.tar.gz: 26f1b41b8e6426288583dcfa44ffa9ba237934f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47af4dbdf5fd8ede360fbd02cc9a5232091a6f2a2b5c26fdb0edbdd0ed4c2a914d403c522c40db780d636350a1cb51d9fb006e2bd3de94e3f651283dace94070
|
7
|
+
data.tar.gz: 8cca8e4cd1c6c9f4da75d27e412b5d80403d7b2f2deaae113acfc46427536917eebffaf84bddafa5514a25316bf82b75cf10249249342942a3e260eaa0a1e6b2
|
@@ -5,10 +5,10 @@ module EnjuCirculation
|
|
5
5
|
def initialize(user, ip_address = nil)
|
6
6
|
case user.try(:role).try(:name)
|
7
7
|
when 'Administrator'
|
8
|
-
can :destroy, Manifestation do |manifestation|
|
8
|
+
can [:destroy, :delete], Manifestation do |manifestation|
|
9
9
|
manifestation.items.empty? and !manifestation.periodical_master? and !manifestation.is_reserved?
|
10
10
|
end
|
11
|
-
can :destroy, User do |u|
|
11
|
+
can [:destroy, :delete], User do |u|
|
12
12
|
u.deletable? and u != user
|
13
13
|
end
|
14
14
|
can :manage, [
|
@@ -30,7 +30,7 @@ module EnjuCirculation
|
|
30
30
|
UserReserveStat
|
31
31
|
]
|
32
32
|
can [:read, :create, :update, :remove_all], Checkout
|
33
|
-
can :destroy, Checkout do |checkout|
|
33
|
+
can [:destroy, :delete], Checkout do |checkout|
|
34
34
|
checkout.checkin
|
35
35
|
end
|
36
36
|
can [:read, :update], [
|
@@ -38,15 +38,15 @@ module EnjuCirculation
|
|
38
38
|
LendingPolicy,
|
39
39
|
UseRestriction
|
40
40
|
]
|
41
|
-
can :destroy, LendingPolicy
|
41
|
+
can [:destroy, :delete], LendingPolicy
|
42
42
|
when 'Librarian'
|
43
|
-
can :destroy, Item do |item|
|
43
|
+
can [:destroy, :delete], Item do |item|
|
44
44
|
item.checkouts.not_returned.empty?
|
45
45
|
end
|
46
|
-
can :destroy, Manifestation do |manifestation|
|
46
|
+
can [:destroy, :delete], Manifestation do |manifestation|
|
47
47
|
manifestation.items.empty? and !manifestation.periodical_master? and !manifestation.is_reserved?
|
48
48
|
end
|
49
|
-
can :destroy, User do |u|
|
49
|
+
can [:destroy, :delete], User do |u|
|
50
50
|
u.deletable? and u.role.name == 'User' and u != user
|
51
51
|
end
|
52
52
|
can :manage, [
|
@@ -58,7 +58,7 @@ module EnjuCirculation
|
|
58
58
|
Reserve
|
59
59
|
]
|
60
60
|
can [:read, :create, :update, :remove_all], Checkout
|
61
|
-
can :destroy, Checkout do |checkout|
|
61
|
+
can [:destroy, :delete], Checkout do |checkout|
|
62
62
|
checkout.checkin
|
63
63
|
end
|
64
64
|
can [:read, :create, :update], UserCheckoutStat
|
@@ -81,14 +81,14 @@ module EnjuCirculation
|
|
81
81
|
can [:show, :update], Checkout do |checkout|
|
82
82
|
checkout.user == user
|
83
83
|
end
|
84
|
-
can :destroy, Checkout do |checkout|
|
84
|
+
can [:destroy, :delete], Checkout do |checkout|
|
85
85
|
checkout.user == user && checkout.checkin
|
86
86
|
end
|
87
87
|
can :index, Reserve
|
88
88
|
can :create, Reserve do |reserve|
|
89
89
|
user.user_number.present?
|
90
90
|
end
|
91
|
-
can [:show, :update, :destroy], Reserve do |reserve|
|
91
|
+
can [:show, :update, :destroy, :delete], Reserve do |reserve|
|
92
92
|
reserve.user == user
|
93
93
|
end
|
94
94
|
can :read, [
|
@@ -27,7 +27,7 @@
|
|
27
27
|
<%- if can? :update, checkout_type -%>
|
28
28
|
<%= link_to t('page.edit'), edit_checkout_type_path(checkout_type) -%>
|
29
29
|
<% end %>
|
30
|
-
<%- if can? :
|
30
|
+
<%- if can? :delete, checkout_type -%>
|
31
31
|
<%= link_to t('page.destroy'), checkout_type, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
|
32
32
|
<% end %>
|
33
33
|
</td>
|
@@ -33,7 +33,7 @@
|
|
33
33
|
<%= link_to t('checkout.extend'), edit_checkout_path(checkout) -%>
|
34
34
|
<% end %>
|
35
35
|
<%- end -%>
|
36
|
-
<%- if can? :
|
36
|
+
<%- if can? :delete, checkout -%>
|
37
37
|
<%= link_to t('page.destroy'), checkout, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
|
38
38
|
<%- end -%>
|
39
39
|
</td>
|
@@ -12,7 +12,7 @@
|
|
12
12
|
<strong><%= t('activerecord.attributes.checkout.due_date') -%></strong><br />
|
13
13
|
<%= l(@checkout.due_date, :format => :only_date) if @checkout.due_date -%>
|
14
14
|
</p>
|
15
|
-
<%- if can? :
|
15
|
+
<%- if can? :delete, @checkout -%>
|
16
16
|
<p>
|
17
17
|
<strong><%= t('checkout.current_user') -%></strong><br />
|
18
18
|
<%= link_to @checkout.user_username, @checkout.user if @checkout.user -%>
|
@@ -23,7 +23,7 @@
|
|
23
23
|
<%- if can? :update, circulation_status -%>
|
24
24
|
<%= link_to t('page.edit'), edit_circulation_status_path(circulation_status) -%>
|
25
25
|
<% end %>
|
26
|
-
<%- if can? :
|
26
|
+
<%- if can? :delete, circulation_status -%>
|
27
27
|
<%= link_to t('page.destroy'), circulation_status, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
|
28
28
|
<%- end -%>
|
29
29
|
</td>
|
@@ -58,7 +58,7 @@
|
|
58
58
|
(<%= link_to reserve.item.item_identifier, reserve.item %>)
|
59
59
|
<% end %>
|
60
60
|
</td>
|
61
|
-
<%- if can? :
|
61
|
+
<%- if can? :delete, reserve -%>
|
62
62
|
<td>
|
63
63
|
<%= link_to t('page.edit'), edit_reserve_path(reserve) -%>
|
64
64
|
<%- if reserve.user.reserves.waiting.include?(reserve) -%>
|
@@ -23,7 +23,7 @@
|
|
23
23
|
<%- if can? :update, use_restriction -%>
|
24
24
|
<%= link_to t('page.edit'), edit_use_restriction_path(use_restriction) -%>
|
25
25
|
<% end %>
|
26
|
-
<%- if can? :
|
26
|
+
<%- if can? :delete, use_restriction -%>
|
27
27
|
<%= link_to t('page.destroy'), use_restriction, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
|
28
28
|
<%- end -%>
|
29
29
|
</td>
|
@@ -5,7 +5,7 @@ module EnjuCirculation
|
|
5
5
|
end
|
6
6
|
|
7
7
|
module ClassMethods
|
8
|
-
def
|
8
|
+
def enju_circulation_user_model
|
9
9
|
include InstanceMethods
|
10
10
|
attr_accessible :save_checkout_history, :checkout_icalendar_token
|
11
11
|
attr_accessible :save_checkout_history, :checkout_icalendar_token,
|
@@ -5,10 +5,10 @@
|
|
5
5
|
def initialize(user, ip_address = nil)
|
6
6
|
case user.try(:role).try(:name)
|
7
7
|
when 'Administrator'
|
8
|
-
can :destroy, Manifestation do |manifestation|
|
8
|
+
can [:delete, :destroy], Manifestation do |manifestation|
|
9
9
|
manifestation.items.empty? and !manifestation.periodical_master? and !manifestation.is_reserved?
|
10
10
|
end
|
11
|
-
can :destroy, User do |u|
|
11
|
+
can [:delete, :destroy], User do |u|
|
12
12
|
u.deletable? and u != user
|
13
13
|
end
|
14
14
|
can :manage, [
|
@@ -30,7 +30,7 @@
|
|
30
30
|
UserReserveStat
|
31
31
|
]
|
32
32
|
can [:read, :create, :update, :remove_all], Checkout
|
33
|
-
can :destroy, Checkout do |checkout|
|
33
|
+
can [:delete, :destroy], Checkout do |checkout|
|
34
34
|
checkout.checkin
|
35
35
|
end
|
36
36
|
can [:read, :update], [
|
@@ -38,16 +38,16 @@
|
|
38
38
|
LendingPolicy,
|
39
39
|
UseRestriction
|
40
40
|
]
|
41
|
-
can :destroy, LendingPolicy
|
41
|
+
can [:delete, :destroy], LendingPolicy
|
42
42
|
can :read, [Item, Manifestation]
|
43
43
|
when 'Librarian'
|
44
|
-
can :destroy, Item do |item|
|
44
|
+
can [:delete, :destroy], Item do |item|
|
45
45
|
item.checkouts.not_returned.empty?
|
46
46
|
end
|
47
|
-
can :destroy, Manifestation do |manifestation|
|
47
|
+
can [:delete, :destroy], Manifestation do |manifestation|
|
48
48
|
manifestation.items.empty? and !manifestation.periodical_master? and !manifestation.is_reserved?
|
49
49
|
end
|
50
|
-
can :destroy, User do |u|
|
50
|
+
can [:delete, :destroy], User do |u|
|
51
51
|
u.deletable? and u.role.name == 'User' and u != user
|
52
52
|
end
|
53
53
|
can :manage, [
|
@@ -59,7 +59,7 @@
|
|
59
59
|
Reserve
|
60
60
|
]
|
61
61
|
can [:read, :create, :update, :remove_all], Checkout
|
62
|
-
can :destroy, Checkout do |checkout|
|
62
|
+
can [:delete, :destroy], Checkout do |checkout|
|
63
63
|
checkout.checkin
|
64
64
|
end
|
65
65
|
can [:read, :create, :update], UserCheckoutStat
|
@@ -83,14 +83,14 @@
|
|
83
83
|
can [:show, :update], Checkout do |checkout|
|
84
84
|
checkout.user == user
|
85
85
|
end
|
86
|
-
can :destroy, Checkout do |checkout|
|
86
|
+
can [:delete, :destroy], Checkout do |checkout|
|
87
87
|
checkout.user == user && checkout.checkin
|
88
88
|
end
|
89
89
|
can :index, Reserve
|
90
90
|
can :create, Reserve do |reserve|
|
91
91
|
user.user_number.present?
|
92
92
|
end
|
93
|
-
can [:show, :update, :destroy], Reserve do |reserve|
|
93
|
+
can [:show, :update, :delete, :destroy], Reserve do |reserve|
|
94
94
|
reserve.user == user
|
95
95
|
end
|
96
96
|
can :read, [
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enju_circulation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.
|
4
|
+
version: 0.1.0.pre15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kosuke Tanabe
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.2.13.
|
19
|
+
version: 3.2.13.rc2
|
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.2.13.
|
26
|
+
version: 3.2.13.rc2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: simple_form
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,28 +86,28 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - ~>
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.1.14.
|
89
|
+
version: 0.1.14.pre4
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ~>
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.1.14.
|
96
|
+
version: 0.1.14.pre4
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: enju_event
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ~>
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.1.17.
|
103
|
+
version: 0.1.17.pre6
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - ~>
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.1.17.
|
110
|
+
version: 0.1.17.pre6
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: sqlite3
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,14 +170,14 @@ dependencies:
|
|
170
170
|
requirements:
|
171
171
|
- - ~>
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 0.1.0.
|
173
|
+
version: 0.1.0.pre23
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - ~>
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: 0.1.0.
|
180
|
+
version: 0.1.0.pre23
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: enju_library
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -612,16 +612,16 @@ files:
|
|
612
612
|
- spec/dummy/solr/conf/spellings.txt
|
613
613
|
- spec/dummy/solr/conf/stopwords.txt
|
614
614
|
- spec/dummy/solr/conf/synonyms.txt
|
615
|
-
- spec/dummy/solr/data/test/index/
|
616
|
-
- spec/dummy/solr/data/test/index/
|
617
|
-
- spec/dummy/solr/data/test/index/
|
618
|
-
- spec/dummy/solr/data/test/index/
|
619
|
-
- spec/dummy/solr/data/test/index/
|
620
|
-
- spec/dummy/solr/data/test/index/
|
621
|
-
- spec/dummy/solr/data/test/index/
|
622
|
-
- spec/dummy/solr/data/test/index/
|
615
|
+
- spec/dummy/solr/data/test/index/_wh.fdt
|
616
|
+
- spec/dummy/solr/data/test/index/_wh.fdx
|
617
|
+
- spec/dummy/solr/data/test/index/_wh.fnm
|
618
|
+
- spec/dummy/solr/data/test/index/_wh.frq
|
619
|
+
- spec/dummy/solr/data/test/index/_wh.nrm
|
620
|
+
- spec/dummy/solr/data/test/index/_wh.prx
|
621
|
+
- spec/dummy/solr/data/test/index/_wh.tii
|
622
|
+
- spec/dummy/solr/data/test/index/_wh.tis
|
623
623
|
- spec/dummy/solr/data/test/index/segments.gen
|
624
|
-
- spec/dummy/solr/data/test/index/
|
624
|
+
- spec/dummy/solr/data/test/index/segments_1t1
|
625
625
|
- spec/dummy/solr/data/test/spellchecker/segments.gen
|
626
626
|
- spec/dummy/solr/data/test/spellchecker/segments_1
|
627
627
|
- spec/factories/basket.rb
|
@@ -885,16 +885,16 @@ test_files:
|
|
885
885
|
- spec/dummy/solr/conf/spellings.txt
|
886
886
|
- spec/dummy/solr/conf/stopwords.txt
|
887
887
|
- spec/dummy/solr/conf/synonyms.txt
|
888
|
-
- spec/dummy/solr/data/test/index/
|
889
|
-
- spec/dummy/solr/data/test/index/
|
890
|
-
- spec/dummy/solr/data/test/index/
|
891
|
-
- spec/dummy/solr/data/test/index/
|
892
|
-
- spec/dummy/solr/data/test/index/
|
893
|
-
- spec/dummy/solr/data/test/index/
|
894
|
-
- spec/dummy/solr/data/test/index/
|
895
|
-
- spec/dummy/solr/data/test/index/
|
888
|
+
- spec/dummy/solr/data/test/index/_wh.fdt
|
889
|
+
- spec/dummy/solr/data/test/index/_wh.fdx
|
890
|
+
- spec/dummy/solr/data/test/index/_wh.fnm
|
891
|
+
- spec/dummy/solr/data/test/index/_wh.frq
|
892
|
+
- spec/dummy/solr/data/test/index/_wh.nrm
|
893
|
+
- spec/dummy/solr/data/test/index/_wh.prx
|
894
|
+
- spec/dummy/solr/data/test/index/_wh.tii
|
895
|
+
- spec/dummy/solr/data/test/index/_wh.tis
|
896
896
|
- spec/dummy/solr/data/test/index/segments.gen
|
897
|
-
- spec/dummy/solr/data/test/index/
|
897
|
+
- spec/dummy/solr/data/test/index/segments_1t1
|
898
898
|
- spec/dummy/solr/data/test/spellchecker/segments.gen
|
899
899
|
- spec/dummy/solr/data/test/spellchecker/segments_1
|
900
900
|
- spec/factories/basket.rb
|