Kohana v3.3.0
This commit is contained in:
31
modules/orm/classes/Model/Auth/Role.php
Normal file
31
modules/orm/classes/Model/Auth/Role.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php defined('SYSPATH') OR die('No direct access allowed.');
|
||||
/**
|
||||
* Default auth role
|
||||
*
|
||||
* @package Kohana/Auth
|
||||
* @author Kohana Team
|
||||
* @copyright (c) 2007-2009 Kohana Team
|
||||
* @license http://kohanaphp.com/license.html
|
||||
*/
|
||||
class Model_Auth_Role extends ORM {
|
||||
|
||||
// Relationships
|
||||
protected $_has_many = array(
|
||||
'users' => array('model' => 'User','through' => 'roles_users'),
|
||||
);
|
||||
|
||||
public function rules()
|
||||
{
|
||||
return array(
|
||||
'name' => array(
|
||||
array('not_empty'),
|
||||
array('min_length', array(':value', 4)),
|
||||
array('max_length', array(':value', 32)),
|
||||
),
|
||||
'description' => array(
|
||||
array('max_length', array(':value', 255)),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
} // End Auth Role Model
|
Reference in New Issue
Block a user