Explicitly state permissions for CommunitySolutionPolicy

This commit is contained in:
Sebastian Serth
2024-05-24 13:35:07 +02:00
committed by Sebastian Serth
parent 2ab4877bd5
commit d0fcb6d695
2 changed files with 56 additions and 0 deletions

View File

@ -1,6 +1,21 @@
# frozen_string_literal: true
class CommunitySolutionPolicy < AdminOnlyPolicy
def show?
# We don't have a show action, so no one can show a CommunitySolution directly.
no_one
end
def new?
# We don't have a destroy action, so no one can create a CommunitySolution directly.
no_one
end
def create?
# We don't have a destroy action, so no one can initialize a CommunitySolution directly.
no_one
end
def edit?
everyone
end
@ -8,4 +23,9 @@ class CommunitySolutionPolicy < AdminOnlyPolicy
def update?
everyone
end
def destroy?
# We don't have a destroy action, so no one can destroy a CommunitySolution directly.
no_one
end
end