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
9623b71a
Commit
9623b71a
authored
Mar 10, 2015
by
Vinnie Okada
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More restricted visibility changes
Bug fixes and new tests for the restricted visibility changes.
parent
928fc94c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
app/helpers/application_settings_helper.rb
app/helpers/application_settings_helper.rb
+2
-1
lib/api/project_snippets.rb
lib/api/project_snippets.rb
+4
-4
No files found.
app/helpers/application_settings_helper.rb
View file @
9623b71a
...
...
@@ -29,7 +29,8 @@ module ApplicationSettingsHelper
checkbox_name
=
'application_setting[restricted_visibility_levels][]'
label_tag
(
checkbox_name
,
class:
css_class
)
do
check_box_tag
(
checkbox_name
,
level
,
checked
,
autocomplete:
'off'
,
check_box_tag
(
checkbox_name
,
level
,
checked
,
autocomplete:
'off'
,
'aria-describedby'
=>
help_block_id
)
+
name
end
end
...
...
lib/api/project_snippets.rb
View file @
9623b71a
...
...
@@ -51,13 +51,13 @@ module API
attrs
=
attributes_for_keys
[
:title
,
:file_name
,
:visibility_level
]
attrs
[
:content
]
=
params
[
:code
]
if
params
[
:code
].
present?
@snippet
=
CreateSnippet
s
ervice
.
new
(
user_project
,
current_user
,
@snippet
=
CreateSnippet
S
ervice
.
new
(
user_project
,
current_user
,
attrs
).
execute
if
@snippet
.
saved?
present
@snippet
,
with:
Entities
::
ProjectSnippet
else
if
@snippet
.
errors
.
any?
render_validation_error!
(
@snippet
)
else
present
@snippet
,
with:
Entities
::
ProjectSnippet
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