first commit
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Permission management.
|
||||
*
|
||||
* @package symfony
|
||||
* @subpackage plugin
|
||||
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||
* @version SVN: $Id: actions.class.php 4 2008-09-24 08:40:58Z marek $
|
||||
*/
|
||||
class sfGuardPermissionActions extends autosfGuardPermissionActions
|
||||
{
|
||||
protected function updatesfGuardPermissionFromRequest()
|
||||
{
|
||||
$sf_guard_permission = $this->getRequestParameter('sf_guard_permission');
|
||||
|
||||
if (isset($sf_guard_permission['name']))
|
||||
{
|
||||
$this->sf_guard_permission->setName($sf_guard_permission['name']);
|
||||
}
|
||||
if (isset($sf_guard_permission['description']))
|
||||
{
|
||||
$this->sf_guard_permission->setDescription($sf_guard_permission['description']);
|
||||
}
|
||||
if (!empty($sf_guard_permission['module_name']))
|
||||
{
|
||||
$this->sf_guard_permission->setModuleName($sf_guard_permission['module_name']);
|
||||
}
|
||||
if (!empty($sf_guard_permission['action_name']))
|
||||
{
|
||||
$this->sf_guard_permission->setActionName($sf_guard_permission['action_name']);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
generator:
|
||||
class: sfPropelAdminGenerator
|
||||
param:
|
||||
model_class: sfGuardPermission
|
||||
theme: default
|
||||
|
||||
list:
|
||||
title: Permission list
|
||||
display: [=name, description]
|
||||
|
||||
edit:
|
||||
title: Edit "%%name%%" permission
|
||||
@@ -0,0 +1,16 @@
|
||||
methods:
|
||||
post:
|
||||
- "sf_guard_permission{name}"
|
||||
|
||||
names:
|
||||
sf_guard_permission{name}:
|
||||
required: yes
|
||||
required_msg: Please, enter a name
|
||||
validators: nameUniqueValidator
|
||||
|
||||
nameUniqueValidator:
|
||||
class: sfPropelUniqueValidator
|
||||
param:
|
||||
class: sfGuardPermission
|
||||
column: name
|
||||
unique_error: This permission name already exists
|
||||
Reference in New Issue
Block a user