Closed
Bug 683025
Opened 13 years ago
Closed 13 years ago
Add a check_for_edit to Bugzilla::Bug to return the bug object if the user can edit the bug
Categories
(Bugzilla :: Bugzilla-General, enhancement)
Bugzilla
Bugzilla-General
Tracking
()
RESOLVED
FIXED
Bugzilla 4.4
People
(Reporter: rowebb, Assigned: rowebb)
Details
Attachments
(1 file, 2 obsolete files)
4.76 KB,
patch
|
mkanat
:
review+
|
Details | Diff | Splinter Review |
There should be a check_for_edit method in Bugzilla::Bug that will run check and take that bug and run can_edit_product. This will either throw a user error if they do not have permissions to edit the bug or will return the created bug object.
Comment 1•13 years ago
|
||
IMO, this doesn't make sense. It should be a User object method, like $user->can_edit_bug($bug)
Comment 2•13 years ago
|
||
No, it's:
my $bug = Bugzilla::Bug->check_for_edit($id);
Assignee | ||
Comment 3•13 years ago
|
||
Attachment #556967 -
Flags: review?(mkanat)
Comment 4•13 years ago
|
||
Comment on attachment 556967 [details] [diff] [review]
Adding check_for_edit to Bugzilla::Bug
Review of attachment 556967 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good on the implementation, but in order for us to accept patches, we require that the code actually be used somewhere. So just convert all the places where we call check() and then can_edit_product into a call to this.
Attachment #556967 -
Flags: review?(mkanat) → review-
Assignee | ||
Comment 5•13 years ago
|
||
Updated the changes and patched all of the places where User->can_edit_product is called after Bug->check.
Attachment #556967 -
Attachment is obsolete: true
Attachment #557026 -
Flags: review?(mkanat)
Comment 6•13 years ago
|
||
Comment on attachment 557026 [details] [diff] [review]
Adding check_for_edit to Bugzilla::Bug change v2
Review of attachment 557026 [details] [diff] [review]:
-----------------------------------------------------------------
Beautiful! This is a very nice cleanup. :-)
Attachment #557026 -
Flags: review?(mkanat) → review+
Updated•13 years ago
|
Flags: approval+
Target Milestone: --- → Bugzilla 5.0
Comment 7•13 years ago
|
||
Comment on attachment 557026 [details] [diff] [review]
Adding check_for_edit to Bugzilla::Bug change v2
>=== modified file 'Bugzilla/Bug.pm'
>+ Bugzilla->user->can_edit_product($bug->{product_id})
Nit: should be ->product_id instead of ->{product_id}
Assignee | ||
Updated•13 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 8•13 years ago
|
||
Updating the diff for the nit pick.
Attachment #557026 -
Attachment is obsolete: true
Updated•13 years ago
|
Attachment #557331 -
Flags: review+
Comment 9•13 years ago
|
||
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/
modified process_bug.cgi
modified Bugzilla/Bug.pm
modified Bugzilla/BugUrl/Bugzilla/Local.pm
modified Bugzilla/WebService/Bug.pm
Committed revision 7949.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•