diff options
| author | cedricnjanga | 2017-08-04 02:09:52 +0200 |
|---|---|---|
| committer | cedricnjanga | 2017-08-04 02:09:52 +0200 |
| commit | 2cf8146cdb4a28fe247108f98c5bc7eb05940e05 (patch) | |
| tree | 281018a6d14ae1d912954daa88a61a6a3e1261f6 | |
| parent | 154760f497eceb8e93e4f63cf16346d99c17d2d2 (diff) | |
| download | chouette-core-2cf8146cdb4a28fe247108f98c5bc7eb05940e05.tar.bz2 | |
Timetable combination policy
| -rw-r--r-- | app/policies/time_table_combination_policy.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/policies/time_table_combination_policy.rb b/app/policies/time_table_combination_policy.rb new file mode 100644 index 000000000..daa6808e4 --- /dev/null +++ b/app/policies/time_table_combination_policy.rb @@ -0,0 +1,12 @@ +class TimeTableCombinationPolicy < ApplicationPolicy + + class Scope < Scope + def resolve + scope + end + end + + def create? + !archived? && organisation_match? && user.has_permission?('time_tables.update') + end +end |
