Commit e0bd3a45 authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent ed3b1698
......@@ -45,12 +45,11 @@ export default {
:data-commit-id="commitId"
class="code diff-wrap-lines js-syntax-highlight text-file js-diff-inline-view"
>
<!-- Need to insert an empty row to solve "table-layout:fixed" equal width when expansion row is the first line -->
<tr>
<td style="width: 50px;"></td>
<td style="width: 50px;"></td>
<td></td>
</tr>
<colgroup>
<col style="width: 50px;" />
<col style="width: 50px;" />
<col />
</colgroup>
<tbody>
<template v-for="(line, index) in diffLines">
<inline-diff-expansion-row
......
......@@ -45,13 +45,12 @@ export default {
:data-commit-id="commitId"
class="code diff-wrap-lines js-syntax-highlight text-file"
>
<!-- Need to insert an empty row to solve "table-layout:fixed" equal width when expansion row is the first line -->
<tr>
<td style="width: 50px;"></td>
<td></td>
<td style="width: 50px;"></td>
<td></td>
</tr>
<colgroup>
<col style="width: 50px;" />
<col />
<col style="width: 50px;" />
<col />
</colgroup>
<tbody>
<template v-for="(line, index) in diffLines">
<parallel-diff-expansion-row
......
......@@ -44,25 +44,25 @@ class GroupPolicy < BasePolicy
rule { public_group }.policy do
enable :read_group
enable :read_list
enable :read_label
end
rule { logged_in_viewable }.enable :read_group
rule { guest }.policy do
enable :read_group
enable :read_list
enable :upload_file
enable :read_label
end
rule { admin }.enable :read_group
rule { has_projects }.policy do
enable :read_group
end
rule { can?(:read_group) }.policy do
enable :read_milestone
enable :read_list
enable :read_label
enable :read_group
end
rule { has_access }.enable :read_namespace
......
# frozen_string_literal: true
class MilestonePolicy < BasePolicy
delegate { @subject.project }
delegate { @subject.parent }
end
......@@ -6,10 +6,6 @@
- if current_user.snippets.exists?
= render partial: 'snippets/snippets_scope_menu', locals: { include_private: true }
.d-block.d-sm-none
&nbsp;
= link_to _("New snippet"), new_snippet_path, class: "btn btn-success btn-block", title: _("New snippet")
- if current_user.snippets.exists?
= render partial: 'shared/snippets/list', locals: { link_project: true }
- else
......
---
title: Remove thin white line at top of diff view code blocks
merge_request: 17026
author:
type: fixed
---
title: Fix permissions for group milestones
merge_request:
author:
type: fixed
---
title: Remove duplicate primary button in dashboard snippets
merge_request: 32048
author: George Tsiolis
type: fixed
......@@ -2,7 +2,7 @@
module Gitlab
class SearchResults
COUNT_LIMIT = 101
COUNT_LIMIT = 100
COUNT_LIMIT_MESSAGE = "#{COUNT_LIMIT - 1}+"
attr_reader :current_user, :query, :per_page
......
......@@ -57,8 +57,8 @@ describe Gitlab::SearchResults do
where(:count, :expected) do
23 | '23'
100 | '100'
101 | max_limited_count
99 | '99'
100 | max_limited_count
1234 | max_limited_count
end
......
......@@ -9,6 +9,7 @@ describe GroupPolicy do
it do
expect_allowed(:read_group)
expect_allowed(*read_group_permissions)
expect_disallowed(:upload_file)
expect_disallowed(*reporter_permissions)
expect_disallowed(*developer_permissions)
......@@ -27,6 +28,7 @@ describe GroupPolicy do
end
it { expect_disallowed(:read_group) }
it { expect_disallowed(*read_group_permissions) }
end
context 'with foreign user and public project' do
......@@ -39,6 +41,7 @@ describe GroupPolicy do
end
it { expect_disallowed(:read_group) }
it { expect_disallowed(*read_group_permissions) }
end
context 'has projects' do
......@@ -49,13 +52,13 @@ describe GroupPolicy do
project.add_developer(current_user)
end
it { expect_allowed(:read_label, :read_list) }
it { expect_allowed(*read_group_permissions) }
context 'in subgroups' do
let(:subgroup) { create(:group, :private, parent: group) }
let(:project) { create(:project, namespace: subgroup) }
it { expect_allowed(:read_label, :read_list) }
it { expect_allowed(*read_group_permissions) }
end
end
......@@ -63,6 +66,7 @@ describe GroupPolicy do
let(:current_user) { guest }
it do
expect_allowed(*read_group_permissions)
expect_allowed(*guest_permissions)
expect_disallowed(*reporter_permissions)
expect_disallowed(*developer_permissions)
......@@ -75,6 +79,7 @@ describe GroupPolicy do
let(:current_user) { reporter }
it do
expect_allowed(*read_group_permissions)
expect_allowed(*guest_permissions)
expect_allowed(*reporter_permissions)
expect_disallowed(*developer_permissions)
......@@ -87,6 +92,7 @@ describe GroupPolicy do
let(:current_user) { developer }
it do
expect_allowed(*read_group_permissions)
expect_allowed(*guest_permissions)
expect_allowed(*reporter_permissions)
expect_allowed(*developer_permissions)
......@@ -110,6 +116,7 @@ describe GroupPolicy do
updated_owner_permissions =
owner_permissions - create_subgroup_permission
expect_allowed(*read_group_permissions)
expect_allowed(*guest_permissions)
expect_allowed(*reporter_permissions)
expect_allowed(*developer_permissions)
......@@ -120,6 +127,7 @@ describe GroupPolicy do
context 'with subgroup_creation_level set to owner' do
it 'allows every maintainer permission' do
expect_allowed(*read_group_permissions)
expect_allowed(*guest_permissions)
expect_allowed(*reporter_permissions)
expect_allowed(*developer_permissions)
......@@ -133,6 +141,7 @@ describe GroupPolicy do
let(:current_user) { owner }
it do
expect_allowed(*read_group_permissions)
expect_allowed(*guest_permissions)
expect_allowed(*reporter_permissions)
expect_allowed(*developer_permissions)
......@@ -145,6 +154,7 @@ describe GroupPolicy do
let(:current_user) { admin }
it do
expect_allowed(*read_group_permissions)
expect_allowed(*guest_permissions)
expect_allowed(*reporter_permissions)
expect_allowed(*developer_permissions)
......@@ -176,6 +186,7 @@ describe GroupPolicy do
let(:current_user) { nil }
it do
expect_disallowed(*read_group_permissions)
expect_disallowed(*guest_permissions)
expect_disallowed(*reporter_permissions)
expect_disallowed(*developer_permissions)
......@@ -188,6 +199,7 @@ describe GroupPolicy do
let(:current_user) { guest }
it do
expect_allowed(*read_group_permissions)
expect_allowed(*guest_permissions)
expect_disallowed(*reporter_permissions)
expect_disallowed(*developer_permissions)
......@@ -200,6 +212,7 @@ describe GroupPolicy do
let(:current_user) { reporter }
it do
expect_allowed(*read_group_permissions)
expect_allowed(*guest_permissions)
expect_allowed(*reporter_permissions)
expect_disallowed(*developer_permissions)
......@@ -212,6 +225,7 @@ describe GroupPolicy do
let(:current_user) { developer }
it do
expect_allowed(*read_group_permissions)
expect_allowed(*guest_permissions)
expect_allowed(*reporter_permissions)
expect_allowed(*developer_permissions)
......@@ -224,6 +238,7 @@ describe GroupPolicy do
let(:current_user) { maintainer }
it do
expect_allowed(*read_group_permissions)
expect_allowed(*guest_permissions)
expect_allowed(*reporter_permissions)
expect_allowed(*developer_permissions)
......@@ -236,6 +251,7 @@ describe GroupPolicy do
let(:current_user) { owner }
it do
expect_allowed(*read_group_permissions)
expect_allowed(*guest_permissions)
expect_allowed(*reporter_permissions)
expect_allowed(*developer_permissions)
......
......@@ -16,6 +16,7 @@ RSpec.shared_context 'GroupPolicy context' do
read_group_merge_requests
]
end
let(:read_group_permissions) { %i[read_label read_list read_milestone] }
let(:reporter_permissions) { %i[admin_label read_container_image] }
let(:developer_permissions) { [:admin_milestone] }
let(:maintainer_permissions) 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