diff options
Diffstat (limited to 'app/policies/design_management')
4 files changed, 31 insertions, 0 deletions
diff --git a/app/policies/design_management/design_at_version_policy.rb b/app/policies/design_management/design_at_version_policy.rb new file mode 100644 index 00000000000..9decbc0c4b2 --- /dev/null +++ b/app/policies/design_management/design_at_version_policy.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +module DesignManagement + class DesignAtVersionPolicy < ::BasePolicy + delegate { @subject.version } + delegate { @subject.design } + end +end diff --git a/app/policies/design_management/design_collection_policy.rb b/app/policies/design_management/design_collection_policy.rb new file mode 100644 index 00000000000..6a833da27cc --- /dev/null +++ b/app/policies/design_management/design_collection_policy.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module DesignManagement + class DesignCollectionPolicy < DesignPolicy + # Delegates everything to the `issue` just like the `DesignPolicy` + end +end diff --git a/app/policies/design_management/design_policy.rb b/app/policies/design_management/design_policy.rb new file mode 100644 index 00000000000..57846095f80 --- /dev/null +++ b/app/policies/design_management/design_policy.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +module DesignManagement + class DesignPolicy < ::BasePolicy + # The IssuePolicy will delegate to the ProjectPolicy + delegate { @subject.issue } + end +end diff --git a/app/policies/design_management/version_policy.rb b/app/policies/design_management/version_policy.rb new file mode 100644 index 00000000000..1c59ceaea98 --- /dev/null +++ b/app/policies/design_management/version_policy.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +module DesignManagement + class VersionPolicy < ::BasePolicy + # The IssuePolicy will delegate to the ProjectPolicy + delegate { @subject.issue } + end +end |