Avail feature updated
[ninja.git] / modules / orm / models / savedfilter.php
blob1fb854ceda0c44ce0860371991d2f31c30d4df7c
1 <?php
3 require_once( dirname(__FILE__).'/base/basesavedfilter.php' );
5 /**
6 * Autogenerated class SavedFilter_Model
8 * @todo: documentation
9 */
10 class SavedFilter_Model extends BaseSavedFilter_Model {
11 /**
12 * An array containing the custom column dependencies
14 static public $rewrite_columns = array(
15 'scope' => array('username'),
16 'deletable' => array('username')
19 /**
20 * Get the scope as a string
22 public function get_scope() {
23 if( $this->get_username() === false ) {
24 return 'global';
26 return 'user';
29 /**
30 * Get if current user is allowed to delete the object
32 public function get_deletable() {
33 switch( $this->get_scope() ) {
34 case 'user': return true;
35 case 'global': return op5auth::instance()->authorized_for('saved_filters_global');
37 return false;