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
0
Merge Requests
0
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
Kazuhiko Shiozaki
gitlab-ce
Commits
e3ee46a1
Commit
e3ee46a1
authored
Dec 10, 2015
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't allow to edit award emoji comments
parent
bdc62d70
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletion
+19
-1
CHANGELOG
CHANGELOG
+1
-0
app/models/note.rb
app/models/note.rb
+1
-1
spec/models/note_spec.rb
spec/models/note_spec.rb
+17
-0
No files found.
CHANGELOG
View file @
e3ee46a1
...
@@ -27,6 +27,7 @@ v 8.3.0 (unreleased)
...
@@ -27,6 +27,7 @@ v 8.3.0 (unreleased)
- Improve wording on project visibility levels (Zeger-Jan van de Weg)
- Improve wording on project visibility levels (Zeger-Jan van de Weg)
- Automatically select default clone protocol based on user preferences (Eirik Lygre)
- Automatically select default clone protocol based on user preferences (Eirik Lygre)
- Make Network page as sub tab of Commits
- Make Network page as sub tab of Commits
- Prevent possible XSS attack with award-emoji
v 8.2.3
v 8.2.3
- Fix application settings cache not expiring after changes (Stan Hu)
- Fix application settings cache not expiring after changes (Stan Hu)
...
...
app/models/note.rb
View file @
e3ee46a1
...
@@ -350,7 +350,7 @@ class Note < ActiveRecord::Base
...
@@ -350,7 +350,7 @@ class Note < ActiveRecord::Base
end
end
def
editable?
def
editable?
!
system
?
!
system
?
&&
!
is_award
end
end
# Checks if note is an award added as a comment
# Checks if note is an award added as a comment
...
...
spec/models/note_spec.rb
View file @
e3ee46a1
...
@@ -142,4 +142,21 @@ describe Note, models: true do
...
@@ -142,4 +142,21 @@ describe Note, models: true do
expect
(
Note
.
grouped_awards
.
first
.
last
).
to
match_array
(
Note
.
all
)
expect
(
Note
.
grouped_awards
.
first
.
last
).
to
match_array
(
Note
.
all
)
end
end
end
end
describe
"editable?"
do
it
"returns true"
do
note
=
build
(
:note
)
expect
(
note
.
editable?
).
to
be_truthy
end
it
"returns false"
do
note
=
build
(
:note
,
system:
true
)
expect
(
note
.
editable?
).
to
be_falsy
end
it
"returns false"
do
note
=
build
(
:note
,
is_award:
true
,
note:
"smiley"
)
expect
(
note
.
editable?
).
to
be_falsy
end
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