Ejemplo n.º 1
0
 public function addPermissionByName($name, $con = null)
 {
     $permission = Doctrine::getTable('sfGuardPermission')->findOneByName($name);
     if (!$permission) {
         throw new Exception(sprintf('The permission "%s" does not exist.', $name));
     }
     $up = new sfGuardUserPermission();
     $up->setsfGuardUser($this);
     $up->setsfGuardPermission($permission);
     $up->save($con);
 }
Ejemplo n.º 2
0
 public function addPermissionByName($name, $con = null)
 {
     $permission = sfGuardPermissionPeer::retrieveByName($name);
     if (!$permission) {
         throw new Exception(sprintf('The permission "%s" does not exist.', $name));
     }
     $up = new sfGuardUserPermission();
     $up->setsfGuardUser($this);
     $up->setPermissionId($permission->getId());
     $up->save($con);
 }
Ejemplo n.º 3
0
 /**
  * @param	sfGuardUserPermission $sfGuardUserPermission The sfGuardUserPermission object to add.
  */
 protected function doAddsfGuardUserPermission($sfGuardUserPermission)
 {
     $this->collsfGuardUserPermissions[] = $sfGuardUserPermission;
     $sfGuardUserPermission->setsfGuardUser($this);
 }
Ejemplo n.º 4
0
 public function addsfGuardUserPermission(sfGuardUserPermission $l)
 {
     $this->collsfGuardUserPermissions[] = $l;
     $l->setsfGuardUser($this);
 }