Skip to content
Snippets Groups Projects
Commit d5bf57a6 authored by gfyoung's avatar gfyoung
Browse files

Enable frozen string in presenters and policies

Enable frozen string in:

* app/presenters
* app/policies

Partially addresses #47424.
parent f5b45519
No related branches found
No related tags found
1 merge request!10495Merge Requests - Assignee
Showing
with 40 additions and 0 deletions
# frozen_string_literal: true
class ApplicationSetting
class TermPolicy < BasePolicy
include Gitlab::Utils::StrongMemoize
Loading
Loading
# frozen_string_literal: true
require_dependency 'declarative_policy'
 
class BasePolicy < DeclarativePolicy::Base
Loading
Loading
# frozen_string_literal: true
module Ci
class BuildPolicy < CommitStatusPolicy
condition(:protected_ref) do
Loading
Loading
# frozen_string_literal: true
module Ci
class PipelinePolicy < BasePolicy
delegate { @subject.project }
Loading
Loading
# frozen_string_literal: true
module Ci
class PipelineSchedulePolicy < PipelinePolicy
alias_method :pipeline_schedule, :subject
Loading
Loading
# frozen_string_literal: true
module Ci
class RunnerPolicy < BasePolicy
with_options scope: :subject, score: 0
Loading
Loading
# frozen_string_literal: true
module Ci
class TriggerPolicy < BasePolicy
delegate { @subject.project }
Loading
Loading
# frozen_string_literal: true
module Clusters
class ClusterPolicy < BasePolicy
alias_method :cluster, :subject
Loading
Loading
# frozen_string_literal: true
class CommitStatusPolicy < BasePolicy
delegate { @subject.project }
 
Loading
Loading
# frozen_string_literal: true
class DeployKeyPolicy < BasePolicy
with_options scope: :subject, score: 0
condition(:private_deploy_key) { @subject.private? }
Loading
Loading
# frozen_string_literal: true
class DeployTokenPolicy < BasePolicy
with_options scope: :subject, score: 0
condition(:maintainer) { @subject.project.team.maintainer?(@user) }
Loading
Loading
# frozen_string_literal: true
class DeploymentPolicy < BasePolicy
delegate { @subject.project }
end
# frozen_string_literal: true
class EnvironmentPolicy < BasePolicy
delegate { @subject.project }
 
Loading
Loading
# frozen_string_literal: true
class ExternalIssuePolicy < BasePolicy
delegate { @subject.project }
end
# frozen_string_literal: true
class GlobalPolicy < BasePolicy
desc "User is blocked"
with_options scope: :user, score: 0
Loading
Loading
# frozen_string_literal: true
class GroupLabelPolicy < BasePolicy
delegate { @subject.group }
end
# frozen_string_literal: true
class GroupMemberPolicy < BasePolicy
delegate :group
 
Loading
Loading
# frozen_string_literal: true
class GroupPolicy < BasePolicy
desc "Group is public"
with_options scope: :subject, score: 0
Loading
Loading
# frozen_string_literal: true
class IssuablePolicy < BasePolicy
delegate { @subject.project }
 
Loading
Loading
# frozen_string_literal: true
class IssuePolicy < IssuablePolicy
# This class duplicates the same check of Issue#readable_by? for performance reasons
# Make sure to sync this class checks with issue.rb to avoid security problems.
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment