Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 294480 Details for
Bug 406471
3.37: OR based group checking for bugs and product entry
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch containing all changes in one so far
or_groups.patch (text/plain), 9.71 KB, created by
David Lawrence
on 2008-02-09 23:37:12 UTC
(
hide
)
Description:
Patch containing all changes in one so far
Filename:
MIME Type:
Creator:
David Lawrence
Created:
2008-02-09 23:37:12 UTC
Size:
9.71 KB
patch
obsolete
>Index: Bugzilla/Search.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/Search.pm,v >retrieving revision 1.6 >diff -u -r1.6 Search.pm >--- Bugzilla/Search.pm 4 Feb 2008 04:54:54 -0000 1.6 >+++ Bugzilla/Search.pm 9 Feb 2008 23:35:26 -0000 >@@ -780,14 +780,30 @@ > > if ($user->id) { > if (%{$user->groups}) { >- $query .= " AND bug_group_map.group_id NOT IN (" . join(',', values(%{$user->groups})) . ") "; >+ # REDHAT ENTENSION START 406471 >+ # OR based group checking >+ if ( Bugzilla->params->{'or_groups'} ) { >+ $query .= " LEFT JOIN user_group_map " . >+ " ON user_group_map.group_id = bug_group_map.group_id "; >+ # REDHAT ENTENSION END 406471 >+ } else { >+ $query .= " AND bug_group_map.group_id NOT IN (" . join(',', values(%{$user->groups})) . ") "; >+ } > } > > $query .= " LEFT JOIN cc ON cc.bug_id = bugs.bug_id AND cc.who = " . $user->id; > } > >- $query .= " WHERE " . join(' AND ', (@wherepart, @andlist)) . >+ # REDHAT ENTENSION START 406471 >+ # OR based group checking >+ if ( Bugzilla->params->{'or_groups'} ) { >+ $query .= " WHERE " . join(' AND ', (@wherepart, @andlist)) . >+ " AND bugs.creation_ts IS NOT NULL AND (((user_group_map.group_id IS NOT NULL) OR (bug_group_map.bug_id IS NULL))"; >+ # REDHAT ENTENSION END 406471 >+ } else { >+ $query .= " WHERE " . join(' AND ', (@wherepart, @andlist)) . > " AND bugs.creation_ts IS NOT NULL AND ((bug_group_map.group_id IS NULL)"; >+ } > > if ($user->id) { > my $userid = $user->id; >Index: Bugzilla/User.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/User.pm,v >retrieving revision 1.3 >diff -u -r1.3 User.pm >--- Bugzilla/User.pm 20 Jan 2008 16:38:25 -0000 1.3 >+++ Bugzilla/User.pm 9 Feb 2008 23:35:28 -0000 >@@ -584,35 +584,54 @@ > # is cached because this may be called for every row in buglists or > # every bug in a dependency list. > unless ($sth) { >+ # REDHAT EXTENSION START 406471 >+ # Added ability to choose between AND or OR style group checking > $sth = $dbh->prepare("SELECT 1, reporter, assigned_to, qa_contact, > reporter_accessible, cclist_accessible, >- COUNT(cc.who), COUNT(bug_group_map.bug_id) >+ COUNT(cc.who), COUNT(bug_group_map.bug_id), >+ COUNT(user_group_map.group_id) > FROM bugs > LEFT JOIN cc > ON cc.bug_id = bugs.bug_id >- AND cc.who = $userid >+ AND cc.who = $userid > LEFT JOIN bug_group_map > ON bugs.bug_id = bug_group_map.bug_id >- AND bug_group_map.group_ID NOT IN(" . >- $self->groups_as_string . >- ") WHERE bugs.bug_id = ? >- AND creation_ts IS NOT NULL " . >- $dbh->sql_group_by('bugs.bug_id', 'reporter, ' . >- 'assigned_to, qa_contact, reporter_accessible, ' . >- 'cclist_accessible')); >+ LEFT JOIN user_group_map >+ ON user_group_map.group_id = bug_group_map.group_id >+ AND user_group_map.isbless = 0 >+ AND user_group_map.user_id = $userid >+ WHERE bugs.bug_id = ? >+ AND creation_ts IS NOT NULL " . >+ $dbh->sql_group_by('bugs.bug_id', 'reporter, ' . >+ 'assigned_to, qa_contact, reporter_accessible, ' . >+ 'cclist_accessible')); >+ # REDHAT EXTENSION END 406471 > } > $sth->execute($bugid); > my ($ready, $reporter, $owner, $qacontact, $reporter_access, $cclist_access, >- $isoncclist, $missinggroup) = $sth->fetchrow_array(); >+ $isoncclist, $bug_groups, $member_groups) = $sth->fetchrow_array(); > $sth->finish; > $self->{sthCanSeeBug} = $sth; >+ >+ # REDHAT EXTENSION START 406471 >+ # Added ability to choose between AND or OR style group checking >+ my $group_membership = 0; >+ if ( Bugzilla->params->{'or_groups'} ) { >+ $group_membership = 1 if $member_groups; >+ } >+ else { >+ $group_membership = 1 if $bug_groups == $member_groups; >+ } >+ # REDHAT EXTENSION END 406471 >+ # > return ($ready > && ((($reporter == $userid) && $reporter_access) > || (Bugzilla->params->{'useqacontact'} > && $qacontact && ($qacontact == $userid)) > || ($owner == $userid) > || ($isoncclist && $cclist_access) >- || (!$missinggroup))); >+ || ($bug_groups == 0) >+ || $group_membership)); > } > > sub can_see_product { >@@ -636,9 +655,19 @@ > } else { > $query .= " AND group_control_map.membercontrol = " . CONTROLMAPMANDATORY; > } >- $query .= " AND group_id NOT IN(" . $self->groups_as_string . ") " . >- " WHERE group_id IS NULL " . >- "ORDER BY name"; >+ # REDHAT ENTENSION START 406471 >+ # OR based group checking >+ if ( Bugzilla->params->{'or_groups'} ) { >+ $query .= " LEFT JOIN user_group_map" . >+ " ON group_control_map.group_id = user_group_map.group_id" . >+ " WHERE user_group_map.group_id IS NOT NULL" . >+ " OR group_control_map.group_id IS NULL"; >+ } else { >+ $query .= " AND group_id NOT IN (" . $self->groups_as_string . ") " . >+ " WHERE group_id IS NULL "; >+ } >+ $query .= " ORDER BY name"; >+ # REDHAT ENTENSION END 406471 > > my $prod_ids = Bugzilla->dbh->selectcol_arrayref($query); > $self->{selectable_products} = Bugzilla::Product->new_from_list($prod_ids); >@@ -720,17 +749,24 @@ > if (defined $self->{enterable_products}) { > return $self->{enterable_products}; > } >- >- # All products which the user has "Entry" access to. >- my @enterable_ids =@{$dbh->selectcol_arrayref( >- 'SELECT products.id FROM products >- LEFT JOIN group_control_map >- ON group_control_map.product_id = products.id >- AND group_control_map.entry != 0 >- AND group_id NOT IN (' . $self->groups_as_string . ') >- WHERE group_id IS NULL >- AND products.disallownew = 0') || []}; >- >+ # REDHAT EXTENSION START 406471 >+ # add OR based group checking >+ my $query = "SELECT products.id FROM products" . >+ " LEFT JOIN group_control_map" . >+ " ON group_control_map.product_id = products.id" . >+ " AND group_control_map.entry != 0"; >+ if ( Bugzilla->params->{'or_groups'} ) { >+ $query .= " LEFT JOIN user_group_map" . >+ " ON group_control_map.group_id = user_group_map.group_id" . >+ " WHERE user_group_map.group_id IS NOT NULL" . >+ " OR group_control_map.group_id IS NULL" >+ } else { >+ $query .= " AND group_id NOT IN (" . $self->groups_as_string . ")" . >+ " WHERE group_id IS NULL" >+ } >+ $query .= " AND products.disallownew = 0"; >+ # REDHAT EXTENSION END 406471 >+ my @enterable_ids =@{$dbh->selectcol_arrayref($query) || []}; > if (@enterable_ids) { > # And all of these products must have at least one component > # and one version. >Index: Bugzilla/Config/GroupSecurity.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/Config/GroupSecurity.pm,v >retrieving revision 1.1.1.1 >diff -u -r1.1.1.1 GroupSecurity.pm >--- Bugzilla/Config/GroupSecurity.pm 19 Nov 2007 22:11:21 -0000 1.1.1.1 >+++ Bugzilla/Config/GroupSecurity.pm 9 Feb 2008 23:35:28 -0000 >@@ -96,7 +96,16 @@ > name => 'strict_isolation', > type => 'b', > default => 0 >- } ); >+ }, >+# REDHAT EXTENSION START 406471 >+# This param can be set to 1 to enable OR-based groups checking >+ { >+ name => 'or_groups', >+ type => 'b', >+ default => 0 >+ } >+# REDHAT EXTENSION END 406471 >+ ); > return @param_list; > } > >Index: template/en/default/admin/params/groupsecurity.html.tmpl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/template/en/default/admin/params/groupsecurity.html.tmpl,v >retrieving revision 1.1.1.1 >diff -u -r1.1.1.1 groupsecurity.html.tmpl >--- template/en/default/admin/params/groupsecurity.html.tmpl 19 Nov 2007 22:11:21 -0000 1.1.1.1 >+++ template/en/default/admin/params/groupsecurity.html.tmpl 9 Feb 2008 23:35:28 -0000 >@@ -57,6 +57,14 @@ > "or make or remove dependencies " _ > "involving any bug that is in a product on which that " _ > "user is forbidden to edit.", >- >+ # REDHAT ENTENSION START #406471 >+ or_groups => "Allow OR-based groups checking. " _ >+ "If set to on, use OR based group checking. " _ >+ "If set to off, then use AND based group checking. " _ >+ "With OR group checking, a user would need to " _ >+ "be in one or more groups a bug is marked private to. " _ >+ "With AND group checking, a user would need to " _ >+ "be in all groups a bug is marked private to." >+ # REDHAT ENTENSION END #406471 > } > %]
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dkl
: review? (
tfu
)
Actions:
View
|
Diff
Attachments on
bug 406471
:
293982
|
293983
|
293984
|
294053
|
294073
|
294075
|
294076
|
294190
|
294306
|
294480
|
294619
|
294629
|
294714
|
294715
|
294863
|
294968
|
298956