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 {
...
@@ -1057,26 +1057,24 @@ sub get_selectable_products {
my
$class_restricted
=
Bugzilla
->
params
->
{
'useclassification'
}
&&
$class_id
;
my
$class_restricted
=
Bugzilla
->
params
->
{
'useclassification'
}
&&
$class_id
;
if
(
!
defined
$self
->
{
selectable_products
})
{
if
(
!
defined
$self
->
{
selectable_products
})
{
my
$query
=
my
$query
=
"SELECT id
Bugzilla
->
params
->
{
'or_groups'
}
FROM products
?
"SELECT id
LEFT JOIN group_control_map
FROM products
ON group_control_map.product_id = products.id
WHERE id NOT IN (
AND group_control_map.membercontrol = "
.
CONTROLMAPMANDATORY
;
SELECT product_id
FROM group_control_map
if
(
Bugzilla
->
params
->
{
'or_groups'
})
{
WHERE group_control_map.membercontrol = "
.
CONTROLMAPMANDATORY
.
"
# Either the user is in at least one of the MANDATORY groups, or
AND group_id NOT IN ("
.
$self
->
groups_as_string
.
")
# there are no such groups for the product.
)
$query
.=
" WHERE group_id IN ("
.
$self
->
groups_as_string
.
")
ORDER BY name"
OR group_id IS NULL"
;
:
"SELECT id
}
FROM products
else
{
LEFT JOIN group_control_map
# There must be no MANDATORY groups that the user is not in.
ON group_control_map.product_id = products.id
$query
.=
" AND group_id NOT IN ("
.
$self
->
groups_as_string
.
")
AND group_control_map.membercontrol = "
.
CONTROLMAPMANDATORY
.
"
WHERE group_id IS NULL"
;
AND group_id NOT IN("
.
$self
->
groups_as_string
.
")
}
WHERE group_id IS NULL
ORDER BY name"
;
my
$prod_ids
=
Bugzilla
->
dbh
->
selectcol_arrayref
(
$query
);
my
$prod_ids
=
Bugzilla
->
dbh
->
selectcol_arrayref
(
$query
);
$self
->
{
selectable_products
}
=
Bugzilla::
Product
->
new_from_list
(
$prod_ids
);
$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