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
a62b8171
Commit
a62b8171
authored
Feb 17, 2014
by
Gervase Markham
Committed by
Gervase Markham
Feb 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bad or_groups SQL for determining if a user can see a product. r=LpSolit, a=justdave.
https://bugzilla.mozilla.org/show_bug.cgi?id=970228
parent
09317bf9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
20 deletions
+18
-20
User.pm
Bugzilla/User.pm
+18
-20
No files found.
Bugzilla/User.pm
View file @
a62b8171
...
...
@@ -1057,26 +1057,24 @@ sub get_selectable_products {
my
$class_restricted
=
Bugzilla
->
params
->
{
'useclassification'
}
&&
$class_id
;
if
(
!
defined
$self
->
{
selectable_products
})
{
my
$query
=
Bugzilla
->
params
->
{
'or_groups'
}
?
"SELECT id
FROM products
WHERE id NOT IN (
SELECT product_id
FROM group_control_map
WHERE group_control_map.membercontrol = "
.
CONTROLMAPMANDATORY
.
"
AND group_id NOT IN ("
.
$self
->
groups_as_string
.
")
)
ORDER BY name"
:
"SELECT id
FROM products
LEFT JOIN group_control_map
ON group_control_map.product_id = products.id
AND group_control_map.membercontrol = "
.
CONTROLMAPMANDATORY
.
"
AND group_id NOT IN("
.
$self
->
groups_as_string
.
")
WHERE group_id IS NULL
ORDER BY name"
;
my
$query
=
"SELECT id
FROM products
LEFT JOIN group_control_map
ON group_control_map.product_id = products.id
AND group_control_map.membercontrol = "
.
CONTROLMAPMANDATORY
;
if
(
Bugzilla
->
params
->
{
'or_groups'
})
{
# Either the user is in at least one of the MANDATORY groups, or
# there are no such groups for the product.
$query
.=
" WHERE group_id IN ("
.
$self
->
groups_as_string
.
")
OR group_id IS NULL"
;
}
else
{
# There must be no MANDATORY groups that the user is not in.
$query
.=
" AND group_id NOT IN ("
.
$self
->
groups_as_string
.
")
WHERE group_id IS NULL"
;
}
my
$prod_ids
=
Bugzilla
->
dbh
->
selectcol_arrayref
(
$query
);
$self
->
{
selectable_products
}
=
Bugzilla::
Product
->
new_from_list
(
$prod_ids
);
}
...
...
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