[Tickets #8684] Reduce number of calls of hasPermission(PERMS_READ)

View: New views
2 Messages — Rating Filter:   Alert me  

[Tickets #8684] Reduce number of calls of hasPermission(PERMS_READ)

by bugs-14 :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/8684
------------------------------------------------------------------------------
  Ticket             | 8684
  Created By         | patrick.abiven@...
  Summary            | Reduce number of calls of hasPermission(PERMS_READ)
  Queue              | Kronolith
  Version            | FRAMEWORK_3
  Type               | Enhancement
  State              | New
  Priority           | 1. Low
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


patrick.abiven@... (2009-11-06 10:48) wrote:

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






--
You are subscribed to this list as: lists@...
To unsubscribe, mail: bugs-unsubscribe@...

[Tickets #8684] Re: Reduce number of calls of hasPermission(PERMS_READ)

by bugs-14 :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/8684
------------------------------------------------------------------------------
  Ticket             | 8684
  Updated By         | Jan Schneider <jan@...>
  Summary            | Reduce number of calls of hasPermission(PERMS_READ)
  Queue              | Kronolith
  Version            | FRAMEWORK_3
  Type               | Enhancement
-State              | New
+State              | Resolved
  Priority           | 1. Low
-Milestone          |
+Milestone          | 2.3.3
  Patch              |
-Owners             |
+Owners             | Jan Schneider
------------------------------------------------------------------------------


Jan Schneider <jan@...> (2009-11-07 09:39) wrote:

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.





--
You are subscribed to this list as: lists@...
To unsubscribe, mail: bugs-unsubscribe@...