<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>Reduce number of calls of hasPermission(PERMS_READ)</title> 
  <pubDate>Fri, 10 Apr 2026 09:20:56 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/8684</link> 
  <atom:link rel="self" type="application/rss+xml" title="Reduce number of calls of hasPermission(PERMS_READ)" href="https://bugs.horde.org/ticket/8684/rss" /> 
  <description>Reduce number of calls of hasPermission(PERMS_READ)</description> 
 
   
   
  <item> 
   <title>Hello
In lib/Driver.php, adding a new optional argument $pe</title> 
   <description>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-&gt;hasPermission(PERMS_READ);
$event-&gt;getLink($timestamp, true, $this-&gt;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
</description> 
   <pubDate>Fri, 06 Nov 2009 15:48:38 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/8684#t56543</link> 
  </item> 
   
  <item> 
   <title>I decided to only consolidate the two read permission checks</title> 
   <description>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.</description> 
   <pubDate>Sat, 07 Nov 2009 14:39:34 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/8684#t56571</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
