Commit 1737ab0d authored by Sean McGivern's avatar Sean McGivern

Merge branch 'ajk-do-not-require-declarative-policy' into 'master'

Do not require declarative_policy

See merge request gitlab-org/gitlab!59780
parents 5a2cf1b5 2d97b259
......@@ -354,8 +354,6 @@ Performance/Sum:
- 'ee/spec/lib/gitlab/elastic/bulk_indexer_spec.rb'
- 'lib/api/entities/issuable_time_stats.rb'
- 'lib/container_registry/tag.rb'
- 'lib/declarative_policy/rule.rb'
- 'lib/declarative_policy/runner.rb'
- 'lib/gitlab/ci/reports/test_suite_comparer.rb'
- 'lib/gitlab/diff/file.rb'
- 'lib/gitlab/sherlock/transaction.rb'
......
# frozen_string_literal: true
require_dependency 'declarative_policy'
class Ability
class << self
# Given a list of users and a project this method returns the users that can
......
# frozen_string_literal: true
require_dependency 'declarative_policy'
class BasePolicy < DeclarativePolicy::Base
desc "User is an instance admin"
with_options scope: :user, score: 0
......
......@@ -68,7 +68,7 @@ Within the rule DSL, you can use:
- `can?(:other_ability)` delegates to the rules that apply to `:other_ability`. Note that this is distinct from the instance method `can?`, which can check dynamically - this only configures a delegation to another ability.
`~`, `&` and `|` operators are overridden methods in
[`DeclarativePolicy::Rule::Base`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/declarative_policy/rule.rb).
[`DeclarativePolicy::Rule::Base`](https://gitlab.com/gitlab-org/declarative-policy/-/blob/main/lib/declarative_policy/rule.rb).
Do not use boolean operators such as `&&` and `||` within the rule DSL,
as conditions within rule blocks are objects, not booleans. The same
......
# frozen_string_literal: true
require_dependency 'declarative_policy'
module API
class ProjectMirror < ::API::Base
feature_category :continuous_integration
......
# frozen_string_literal: true
require_dependency 'declarative_policy'
module API
class Projects < ::API::Base
include PaginationParams
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment