summaryrefslogtreecommitdiffstats
path: root/lib/model/DomainPermissionPeer.php
blob: c79e0e3dec6b9b221f7a983a3a03fa0ddfe551e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php

/**
 * Subclass for performing query and update operations on the 'domain_permission' table.
 *
 * 
 *
 * @package lib.model
 */ 
class DomainPermissionPeer extends BaseDomainPermissionPeer
{
	// inject domain permissions criteria
	public static function addDomainPermissionCriteria(Criteria $criteria, $domain_id = DomainPeer::DOMAIN_ID)
	{
		if(sfContext::getInstance()->getUser()->hasCredential("superadmin"))
			return;

		// set domain permissions
		$criteria->addJoin(DomainPermissionPeer::DOMAIN_ID, $domain_id);
		$criteria->add(DomainPermissionPeer::USER_ID, sfContext::getInstance()->getUser()->getId());
	}
}