6.0.0-beta1
8/15/25

[#8684] Reduce number of calls of hasPermission(PERMS_READ)
Summary Reduce number of calls of hasPermission(PERMS_READ)
Queue Kronolith
Queue Version FRAMEWORK_3
Type Enhancement
State Resolved
Priority 1. Low
Owners jan (at) horde (dot) org
Requester patrick.abiven (at) apitech (dot) fr
Created 11/06/2009 (5761 days ago)
Due
Updated 11/07/2009 (5760 days ago)
Assigned
Resolved 11/07/2009 (5760 days ago)
Milestone 2.3.3
Patch No

History
11/07/2009 02:39:34 PM Jan Schneider Comment #2
Assigned to Jan Schneider
State ⇒ Resolved
Milestone ⇒ 2.3.3
Reply to this comment
I decided to only consolidate the two read permission checks inside 
getLink(). It would really reduce readability and maintainability if 
this (and only this, i.e. not the delete and edit checks) is moved out 
of this method.
11/06/2009 03:48:38 PM patrick (dot) abiven (at) apitech (dot) fr Comment #1
Priority ⇒ 1. Low
Patch ⇒ No
Milestone ⇒
Queue ⇒ Kronolith
Summary ⇒ Reduce number of calls of hasPermission(PERMS_READ)
Type ⇒ Enhancement
State ⇒ New
Reply to this comment
Hello
In lib/Driver.php, adding a new optional argument $permsread in the 
getLink() function enables a valuable optimization (15 seconds instead 
of 21 seconds in our scenario). Instead of calling 3 times 
hasPermission() we just do a single call.

In lib/Views/Month.php, function html()
$permread = $event->hasPermission(PERMS_READ);
$event->getLink($timestamp, true, $this->link(0, true, $permread)

And then in lib/Driver.php, function getLink() we do not call twice 
hasPermission but we use the optional argument.

Regards

Saved Queries