aboutsummaryrefslogtreecommitdiffstats
path: root/app/policies/time_table_policy.rb
diff options
context:
space:
mode:
authorRobert2017-05-31 10:16:24 +0200
committerRobert2017-05-31 10:16:24 +0200
commit82921d0135bea20964e85ab10797f724414a9b24 (patch)
treed4835989f52727ad5e9da6891d7070f0fd08547a /app/policies/time_table_policy.rb
parent19b000d64bf57e345d80fbf9a2c69aeef11fdee1 (diff)
downloadchouette-core-82921d0135bea20964e85ab10797f724414a9b24.tar.bz2
hotfix for broken code realoading due to standard vanilla AOP implementation
Diffstat (limited to 'app/policies/time_table_policy.rb')
-rw-r--r--app/policies/time_table_policy.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/app/policies/time_table_policy.rb b/app/policies/time_table_policy.rb
index efab6ac00..e915ede6a 100644
--- a/app/policies/time_table_policy.rb
+++ b/app/policies/time_table_policy.rb
@@ -1,5 +1,4 @@
class TimeTablePolicy < BoivPolicy
- extend Policies::Chain
class Scope < Scope
def resolve
@@ -7,22 +6,20 @@ class TimeTablePolicy < BoivPolicy
end
end
- chain_policies :archived?, :!, policies: %i{create? destroy? duplicate? edit?}
-
def create?
- user.has_permission?('time_tables.create') # organisation match via referential is checked in the view
+ !archived? && user.has_permission?('time_tables.create') # organisation match via referential is checked in the view
end
def edit?
- organisation_match? && user.has_permission?('time_tables.edit')
+ !archived? && organisation_match? && user.has_permission?('time_tables.edit')
end
def destroy?
- organisation_match? && user.has_permission?('time_tables.destroy')
+ !archived? && organisation_match? && user.has_permission?('time_tables.destroy')
end
def duplicate?
- organisation_match? && create?
+ !archived? && organisation_match? && create?
end
def update? ; edit? end