aboutsummaryrefslogtreecommitdiffstats
path: root/app/policies/time_table_policy.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/policies/time_table_policy.rb')
-rw-r--r--app/policies/time_table_policy.rb17
1 files changed, 7 insertions, 10 deletions
diff --git a/app/policies/time_table_policy.rb b/app/policies/time_table_policy.rb
index 30df8939b..acd31e9b1 100644
--- a/app/policies/time_table_policy.rb
+++ b/app/policies/time_table_policy.rb
@@ -6,26 +6,23 @@ class TimeTablePolicy < ApplicationPolicy
end
end
- def actualize?
- !archived? && organisation_match? && edit?
- end
-
def create?
!archived? && user.has_permission?('time_tables.create') # organisation match via referential is checked in the view
end
- def edit?
+ def destroy?
+ !archived? && organisation_match? && user.has_permission?('time_tables.destroy')
+ end
+
+ def update?
!archived? && organisation_match? && user.has_permission?('time_tables.edit')
end
- def destroy?
- !archived? && organisation_match? && user.has_permission?('time_tables.destroy')
+ def actualize?
+ !archived? && organisation_match? && edit?
end
def duplicate?
!archived? && organisation_match? && create?
end
-
- def update? ; edit? end
- def new? ; create? end
end