Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
7b84e864
Commit
7b84e864
authored
Jan 09, 2020
by
Mark Chao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mark FoundBlob to be policy aware
parent
8216e0be
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
lib/gitlab/search/found_blob.rb
lib/gitlab/search/found_blob.rb
+1
-0
spec/lib/gitlab/search/found_blob_spec.rb
spec/lib/gitlab/search/found_blob_spec.rb
+10
-0
No files found.
lib/gitlab/search/found_blob.rb
View file @
7b84e864
...
...
@@ -7,6 +7,7 @@ module Gitlab
include
Presentable
include
BlobLanguageFromGitAttributes
include
Gitlab
::
Utils
::
StrongMemoize
include
BlobActiveModel
attr_reader
:project
,
:content_match
,
:blob_path
...
...
spec/lib/gitlab/search/found_blob_spec.rb
View file @
7b84e864
...
...
@@ -156,4 +156,14 @@ describe Gitlab::Search::FoundBlob do
end
end
end
describe
'policy'
do
let
(
:project
)
{
build
(
:project
,
:repository
)
}
subject
{
described_class
.
new
(
project:
project
)
}
it
'works with policy'
do
expect
(
Ability
.
allowed?
(
project
.
creator
,
:read_blob
,
subject
)).
to
be_truthy
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment