Skip to content

Commit

Permalink
Merge pull request #191 from camsys/quarter3
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
mathmerized authored Oct 1, 2018
2 parents 1265d71 + 274dd27 commit 5c44678
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions app/models/abilities/authorized_asset_event_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ def initialize(user, organization_ids=[])
#-------------------------------------------------------------------------
# Can manage asset events if the asset is owned by their organization
can :manage, AssetEvent do |ae|
ae.asset_event_type.try(:active) && organization_ids.include?(ae.asset.organization_id)
ae.asset_event_type.try(:active) && organization_ids.include?(ae.asset.try(:organization_id))
end

cannot :create, DispositionUpdateEvent do |ae|
!ae.asset.disposable?(false)
!ae.asset.try(:disposable?,false)
end


Expand All @@ -30,11 +30,11 @@ def initialize(user, organization_ids=[])

# Can manage asset events if the asset is owned by their organization
can :manage, AssetEvent do |ae|
ae.asset_event_type.try(:active) && organization_ids.include?(ae.transam_asset.organization_id)
ae.asset_event_type.try(:active) && organization_ids.include?(ae.transam_asset.try(:organization_id))
end

cannot :create, DispositionUpdateEvent do |ae|
!ae.transam_asset.disposable?(false)
!ae.transam_asset.try(:disposable?,false)
end


Expand Down
8 changes: 4 additions & 4 deletions app/models/abilities/manager_asset_event_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ def initialize(user)
#-------------------------------------------------------------------------
# managers can manage asset events if the asset's organization is in their list
can :manage, AssetEvent do |ae|
ae.asset_event_type.try(:active) && user.organization_ids.include?(ae.asset.organization_id)
ae.asset_event_type.try(:active) && user.organization_ids.include?(ae.asset.try(:organization_id))
end

can :manage, EarlyDispositionRequestUpdateEvent do |ae|
ae.asset_event_type.try(:active)
end

cannot :create, DispositionUpdateEvent do |ae|
!ae.asset.disposable?(true)
!ae.asset.try(:disposable?,true)
end

cannot :create, EarlyDispositionRequestUpdateEvent do |ae|
Expand All @@ -26,11 +26,11 @@ def initialize(user)

# managers can manage asset events if the asset's organization is in their list
can :manage, AssetEvent do |ae|
ae.asset_event_type.try(:active) && user.organization_ids.include?(ae.transam_asset.organization_id)
ae.asset_event_type.try(:active) && user.organization_ids.include?(ae.transam_asset.try(:organization_id))
end

cannot :create, DispositionUpdateEvent do |ae|
!ae.transam_asset.disposable?(true)
!ae.transam_asset.try(:disposable?,true)
end

cannot :create, EarlyDispositionRequestUpdateEvent do |ae|
Expand Down
2 changes: 1 addition & 1 deletion lib/transam_core/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module TransamCore
VERSION = "2.3.9"
VERSION = "2.3.10"
end

0 comments on commit 5c44678

Please sign in to comment.