Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
82bab122
Commit
82bab122
authored
Feb 15, 2013
by
Hugo Seabrook
Committed by
Byron Jones
Feb 15, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 830330: Make flags honour bug_check_can_change_field
r=dkl, a=LpSolit
parent
921e81ca
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
Bug.pm
Bugzilla/Bug.pm
+2
-2
Flag.pm
Bugzilla/Flag.pm
+6
-0
list.html.tmpl
template/en/default/flag/list.html.tmpl
+1
-1
No files found.
Bugzilla/Bug.pm
View file @
82bab122
...
...
@@ -4085,8 +4085,8 @@ sub check_can_change_field {
return
1
;
}
# Allow anyone to change comments
.
if
(
$field
=~
/^longdesc/
)
{
# Allow anyone to change comments
, or set flags
if
(
$field
=~
/^longdesc/
||
$field
eq
'flagtypes.name'
)
{
return
1
;
}
...
...
Bugzilla/Flag.pm
View file @
82bab122
...
...
@@ -294,6 +294,12 @@ sub set_flag {
ThrowCodeError
(
'flag_unexpected_object'
,
{
'caller'
=>
ref
$obj
});
}
# Make sure the user can change flags
my
$privs
;
$bug
->
check_can_change_field
(
'flagtypes.name'
,
0
,
1
,
\
$privs
)
||
ThrowUserError
(
'illegal_change'
,
{
field
=>
'flagtypes.name'
,
privs
=>
$privs
});
# Update (or delete) an existing flag.
if
(
$params
->
{
id
})
{
my
$flag
=
$class
->
check
({
id
=>
$params
->
{
id
}
});
...
...
template/en/default/flag/list.html.tmpl
View file @
82bab122
...
...
@@ -6,7 +6,7 @@
# defined by the Mozilla Public License, v. 2.0.
#%]
[% IF user.id
AND !read_only_flags
%]
[% IF user.id
&& !read_only_flags && bug.check_can_change_field('flagtypes.name', 0, 1)
%]
[%# We list flags by looping twice over the flag types relevant for the bug.
# In the first loop, we display existing flags and then, for active types,
...
...
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