1: <?php
2: /**
3: * Copyright 1999-2012 Horde LLC (http://www.horde.org/)
4: *
5: * See the enclosed file COPYING for license information (GPL). If you
6: * did not receive this file, see http://www.horde.org/licenses/gpl.
7: *
8: * @author Luc Saillard <luc.saillard@fr.alcove.com>
9: * @author Chuck Hagenbuch <chuck@horde.org>
10: * @author Jan Schneider <jan@horde.org>
11: * @author Michael J. Rubinsky <mrubinsk@horde.org>
12: *
13: * @package Kronolith
14: */
15: class Kronolith_Event_Resource extends Kronolith_Event_Sql
16: {
17: /**
18: * The type of the calender this event exists on.
19: *
20: * @var string
21: */
22: public $calendarType = 'resource';
23:
24: /**
25: * Returns a reference to a driver that's valid for this event.
26: *
27: * @return Kronolith_Driver A driver that this event can use to save
28: * itself, etc.
29: */
30: public function getDriver()
31: {
32: return Kronolith::getDriver('Resource', $this->calendar);
33: }
34:
35: /**
36: * Encapsulates permissions checking. For now, admins, and ONLY admins have
37: * any permissions to a resource's events.
38: *
39: * @param integer $permission The permission to check for.
40: * @param string $user The user to check permissions for.
41: *
42: * @return boolean
43: */
44: public function hasPermission($permission, $user = null)
45: {
46: return $GLOBALS['registry']->isAdmin();
47: }
48:
49: }
50: