53 lines
1.6 KiB
PHP
53 lines
1.6 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of the symfony package.
|
|
* (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
/**
|
|
*
|
|
* @package symfony
|
|
* @subpackage plugin
|
|
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
|
* @version SVN: $Id: sfGuardUserGroupPeer.php 4 2008-09-24 08:40:58Z marek $
|
|
*/
|
|
class sfGuardUserGroupPeer extends BasesfGuardUserGroupPeer
|
|
{
|
|
/**
|
|
* Zwraca listę zezwoleń dla danego użytkownika
|
|
*
|
|
* @param sfGuardUser $user
|
|
* @return sfGuardPermission[]
|
|
* @throws PropelException
|
|
*/
|
|
public static function doSelectPermissionsByUser(sfGuardUser $user)
|
|
{
|
|
$c = new Criteria();
|
|
$c->addJoin(sfGuardPermissionPeer::ID, sfGuardGroupPermissionPeer::PERMISSION_ID);
|
|
$c->addJoin(sfGuardGroupPermissionPeer::GROUP_ID, self::GROUP_ID);
|
|
$c->add(self::USER_ID, $user->getId());
|
|
|
|
return sfGuardPermissionPeer::doSelect($c);
|
|
}
|
|
|
|
/**
|
|
* Zwraca listę zezwoleń modułów dla danego użytkownika
|
|
*
|
|
* @param sfGuardUser $user
|
|
* @return sfGuardGroupModulePermission[]
|
|
* @throws PropelException
|
|
*/
|
|
public static function doSelectModulePermissionsByUser(sfGuardUser $user)
|
|
{
|
|
$c = new Criteria();
|
|
$c->addJoin(sfGuardGroupModulePermissionPeer::ID, self::GROUP_ID);
|
|
$c->add(self::USER_ID, $user->getId());
|
|
|
|
return sfGuardGroupModulePermissionPeer::doSelect($c);
|
|
}
|
|
}
|