[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [17110] eventplanner: acl on customer report
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [17110] eventplanner: acl on customer report |
Date: |
Fri, 22 Sep 2017 03:18:16 -0400 (EDT) |
Revision: 17110
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17110
Author: sigurdne
Date: 2017-09-22 03:18:16 -0400 (Fri, 22 Sep 2017)
Log Message:
-----------
eventplanner: acl on customer report
Modified Paths:
--------------
trunk/eventplanner/inc/class.socustomer_report.inc.php
Modified: trunk/eventplanner/inc/class.socustomer_report.inc.php
===================================================================
--- trunk/eventplanner/inc/class.socustomer_report.inc.php 2017-09-21
15:35:40 UTC (rev 17109)
+++ trunk/eventplanner/inc/class.socustomer_report.inc.php 2017-09-22
07:18:16 UTC (rev 17110)
@@ -39,6 +39,7 @@
$this->acl_location =
eventplanner_customer_report::acl_location;
$this->cats = CreateObject('phpgwapi.categories', -1,
'eventplanner', $this->acl_location);
$this->cats->supress_info = true;
+ $this->use_acl = true;
}
/**
@@ -55,7 +56,38 @@
return self::$so;
}
+ function get_acl_condition( )
+ {
+ $acl_condition = parent::get_acl_condition();
+ if($this->relaxe_acl)
+ {
+ return $acl_condition;
+ }
+
+ $sql = "SELECT object_id, permission FROM
eventplanner_permission WHERE subject_id = {$this->account}";
+ $this->db->query($sql,__LINE__,__FILE__);
+ $object_ids = array(-1);
+ while ($this->db->next_record())
+ {
+ $permission = $this->db->f('permission');
+ if($permission & PHPGW_ACL_READ)
+ {
+ $object_ids[] =
$this->db->f('object_id');
+ }
+ }
+
+ if($acl_condition)
+ {
+ return '(' . $acl_condition . ' OR
eventplanner_booking_customer_report.id IN (' . implode(',', $object_ids) .
'))';
+ }
+ else
+ {
+ return 'eventplanner_booking_customer_report.id
IN (' . implode(',', $object_ids) . ')';
+ }
+
+ }
+
protected function populate( array $data )
{
$object = new eventplanner_customer_report();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [17110] eventplanner: acl on customer report,
sigurdne <=