Closed Bug 283582 Opened 19 years ago Closed 18 years ago

Remove UserInGroup in favor of Bugzilla->user->in_group

Categories

(Bugzilla :: Bugzilla-General, enhancement, P3)

2.19.2
enhancement

Tracking

()

RESOLVED FIXED
Bugzilla 3.0

People

(Reporter: mkanat, Assigned: spam)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

The title says it all. Right now we have three ways of checking if a user is in
a group:

1) Bugzilla->user->groups
2) Bugzilla->user->in_group
3) UserInGroup

For clarity and simplcity, I think that #2 should be used in all the places
where we're actually checking if a user has a certain permission, and
UserInGroup should go away and Bugzilla->user->groups should no longer be
directly used for that purpose.

While this happens, I also think that the implementation of in_group should
change to always call ->groups, because we're almost always calling it multiple
times on Bugzilla->user in the same page anyway; one medium-size SQL call is
almost always better than three or four small ones.
Blocks: bz-majorarch
Priority: -- → P3
Target Milestone: --- → Bugzilla 2.22
Depends on: 304696
The trunk is now frozen to prepare Bugzilla 2.22. Enhancement bugs are retargetted to 2.24.
Target Milestone: Bugzilla 2.22 → Bugzilla 2.24
Attached patch patch for tipSplinter Review
Attachment #236547 - Flags: review?(mkanat)
Comment on attachment 236547 [details] [diff] [review]
patch for tip

>+<p><b>Name</b> is what is used with the B<!-- blah -->ugzilla->user->in_group()

  Just say "user->in_group" and leave off the "Bugzilla." That way we don't have to say the word "Bugzilla" in the interface if somebody's renamed it.

  Also, put that in <code></code>.

>Index: template/en/default/admin/groups/list.html.tmpl

  And same in this file.

  Other than that it looks fine. You can fix those two things on checkin.
Attachment #236547 - Flags: review?(mkanat) → review+
Assignee: mkanat → bmo
Flags: approval?
Status: NEW → ASSIGNED
Flags: approval? → approval+
There were two hunks that didn't apply to post_bug.cgi anymore, but those two had already been fixed. :-) So everything was good!

Checking in attachment.cgi;
/cvsroot/mozilla/webtools/bugzilla/attachment.cgi,v  <--  attachment.cgi
new revision: 1.122; previous revision: 1.121
done
Checking in buglist.cgi;
/cvsroot/mozilla/webtools/bugzilla/buglist.cgi,v  <--  buglist.cgi
new revision: 1.345; previous revision: 1.344
done
Checking in chart.cgi;
/cvsroot/mozilla/webtools/bugzilla/chart.cgi,v  <--  chart.cgi
new revision: 1.22; previous revision: 1.21
done
Checking in colchange.cgi;
/cvsroot/mozilla/webtools/bugzilla/colchange.cgi,v  <--  colchange.cgi
new revision: 1.58; previous revision: 1.57
done
Checking in describekeywords.cgi;
/cvsroot/mozilla/webtools/bugzilla/describekeywords.cgi,v  <--  describekeywords.cgi
new revision: 1.20; previous revision: 1.19
done
Checking in editusers.cgi;
/cvsroot/mozilla/webtools/bugzilla/editusers.cgi,v  <--  editusers.cgi
new revision: 1.136; previous revision: 1.135
done
Checking in editwhines.cgi;
/cvsroot/mozilla/webtools/bugzilla/editwhines.cgi,v  <--  editwhines.cgi
new revision: 1.19; previous revision: 1.18
done
Checking in enter_bug.cgi;
/cvsroot/mozilla/webtools/bugzilla/enter_bug.cgi,v  <--  enter_bug.cgi
new revision: 1.148; previous revision: 1.147
done
Checking in post_bug.cgi;
/cvsroot/mozilla/webtools/bugzilla/post_bug.cgi,v  <--  post_bug.cgi
new revision: 1.171; previous revision: 1.170
done
Checking in process_bug.cgi;
/cvsroot/mozilla/webtools/bugzilla/process_bug.cgi,v  <--  process_bug.cgi
new revision: 1.339; previous revision: 1.338
done
Checking in query.cgi;
/cvsroot/mozilla/webtools/bugzilla/query.cgi,v  <--  query.cgi
new revision: 1.170; previous revision: 1.169
done
Checking in quips.cgi;
/cvsroot/mozilla/webtools/bugzilla/quips.cgi,v  <--  quips.cgi
new revision: 1.37; previous revision: 1.36
done
Checking in request.cgi;
/cvsroot/mozilla/webtools/bugzilla/request.cgi,v  <--  request.cgi
new revision: 1.39; previous revision: 1.38
done
Checking in sanitycheck.cgi;
/cvsroot/mozilla/webtools/bugzilla/sanitycheck.cgi,v  <--  sanitycheck.cgi
new revision: 1.124; previous revision: 1.123
done
Checking in show_bug.cgi;
/cvsroot/mozilla/webtools/bugzilla/show_bug.cgi,v  <--  show_bug.cgi
new revision: 1.48; previous revision: 1.47
done
Checking in summarize_time.cgi;
/cvsroot/mozilla/webtools/bugzilla/summarize_time.cgi,v  <--  summarize_time.cginew revision: 1.21; previous revision: 1.20
done
Checking in Bugzilla/Bug.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v  <--  Bug.pm
new revision: 1.146; previous revision: 1.145
done
Checking in Bugzilla/Search.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Search.pm,v  <--  Search.pm
new revision: 1.139; previous revision: 1.138
done
Checking in Bugzilla/Series.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Series.pm,v  <--  Series.pm
new revision: 1.14; previous revision: 1.13
done
Checking in Bugzilla/Template.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Template.pm,v  <--  Template.pm
new revision: 1.60; previous revision: 1.59
done
Checking in Bugzilla/User.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/User.pm,v  <--  User.pm
new revision: 1.129; previous revision: 1.128
done
Checking in template/en/default/admin/groups/create.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/groups/create.html.tmpl,v  <--  create.html.tmpl
new revision: 1.6; previous revision: 1.5
done
Checking in template/en/default/admin/groups/list.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/groups/list.html.tmpl,v  <--  list.html.tmpl
new revision: 1.7; previous revision: 1.6
done
Checking in template/en/default/attachment/create.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/attachment/create.html.tmpl,v  <--  create.html.tmpl
new revision: 1.29; previous revision: 1.28
done
Checking in template/en/default/attachment/edit.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/attachment/edit.html.tmpl,v  <--  edit.html.tmpl
new revision: 1.37; previous revision: 1.36
done
Checking in template/en/default/attachment/list.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/attachment/list.html.tmpl,v  <--  list.html.tmpl
new revision: 1.31; previous revision: 1.30
done
Checking in template/en/default/bug/comments.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/bug/comments.html.tmpl,v  <--  comments.html.tmpl
new revision: 1.27; previous revision: 1.26
done
Checking in template/en/default/bug/edit.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/bug/edit.html.tmpl,v  <--  edit.html.tmpl
new revision: 1.84; previous revision: 1.83
done
Checking in template/en/default/bug/show-multiple.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/bug/show-multiple.html.tmpl,v  <--  show-multiple.html.tmpl
new revision: 1.32; previous revision: 1.31
done
Checking in template/en/default/bug/show.xml.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/bug/show.xml.tmpl,v  <--  show.xml.tmpl
new revision: 1.15; previous revision: 1.14
done
Checking in template/en/default/bug/create/create.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/bug/create/create.html.tmpl,v  <--  create.html.tmpl
new revision: 1.65; previous revision: 1.64
done
Checking in template/en/default/global/user-error.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl,v  <--  user-error.html.tmpl
new revision: 1.186; previous revision: 1.185
done
Checking in template/en/default/list/edit-multiple.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/list/edit-multiple.html.tmpl,v  <--  edit-multiple.html.tmpl
new revision: 1.37; previous revision: 1.36
done
Checking in template/en/default/list/list.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/list/list.html.tmpl,v  <--  list.html.tmpl
new revision: 1.50; previous revision: 1.49
done
Checking in template/en/default/list/quips.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/list/quips.html.tmpl,v  <--  quips.html.tmpl
new revision: 1.18; previous revision: 1.17
done
Checking in template/en/default/reports/create-chart.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/reports/create-chart.html.tmpl,v  <--  create-chart.html.tmpl
new revision: 1.14; previous revision: 1.13
done
Checking in template/en/default/reports/menu.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/reports/menu.html.tmpl,v  <--  menu.html.tmpl
new revision: 1.7; previous revision: 1.6
done
Checking in template/en/default/reports/series.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/reports/series.html.tmpl,v  <--  series.html.tmpl
new revision: 1.8; previous revision: 1.7
done
Checking in template/en/default/search/form.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/search/form.html.tmpl,v <--  form.html.tmpl
new revision: 1.43; previous revision: 1.42
done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Keywords: relnote
Added to the relnotes currently attached to bug 349423.
Keywords: relnote
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: