Commit 2b90e26a authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'mc/feature/fix-permission-check-variable-auditting' into 'master'

Fix variable auditing permission check

See merge request gitlab-org/gitlab!39730
parents c7d3515e f7729cfc
......@@ -96,6 +96,7 @@ From there, you can see the following actions:
- Permission to approve merge requests by authors was updated ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/7531) in GitLab 12.9)
- Number of required approvals was updated ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/7531) in GitLab 12.9)
- Added or removed users and groups from project approval groups ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/213603) in GitLab 13.2)
- Project CI/CD variable added, removed, or protected status changed. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/30857) in GitLab 13.4.
Project events can also be accessed via the [Project Audit Events API](../api/audit_events.md#project-audit-events-starter)
......
......@@ -5,7 +5,7 @@ module Ci
include ::Audit::Changes
def execute
return unless License.feature_available?(:extended_audit_events)
return unless container.feature_available?(:audit_events)
case params[:action]
when :create, :destroy
......
---
title: Move variable audit logging to Starter.
merge_request: 39730
author:
type: changed
......@@ -23,7 +23,7 @@ RSpec.describe Projects::VariablesController do
end
before do
stub_licensed_features(extended_audit_events: true)
stub_licensed_features(audit_events: true)
end
context 'when creating variable' do
......
......@@ -9,7 +9,7 @@ RSpec.describe API::Variables do
before do
project.add_maintainer(user)
stub_licensed_features(extended_audit_events: true)
stub_licensed_features(audit_events: true)
end
describe 'POST /projects/:id/variables' do
......
......@@ -20,9 +20,9 @@ RSpec.describe Ci::AuditVariableChangeService do
group.variables << variable
end
context 'when extended audits are available' do
context 'when audits are available' do
before do
stub_licensed_features(extended_audit_events: true)
stub_licensed_features(audit_events: true)
end
context 'when creating variable' do
......@@ -81,9 +81,9 @@ RSpec.describe Ci::AuditVariableChangeService do
end
end
context 'when extended audits are not available' do
context 'when audits are not available' do
before do
stub_licensed_features(extended_audit_events: false)
stub_licensed_features(audit_events: false)
end
context 'when creating variable' do
......
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