[ Index ]

PHP Cross Reference of GlotPress

title

Body

[close]

/gp-includes/things/ -> administrator-permission.php (source)

   1  <?php
   2  /**
   3   * Things: GP_Administrator_Permission class
   4   *
   5   * @package GlotPress
   6   * @subpackage Things
   7   * @since 2.0.0
   8   */
   9  
  10  /**
  11   * Core class used to implement the administrator permissions.
  12   *
  13   * @since 2.0.0
  14   */
  15  class GP_Administrator_Permission extends GP_Permission {
  16  
  17      var $table_basename           = 'gp_permissions';
  18      var $field_names              = array( 'id', 'user_id', 'action', 'object_type', 'object_id' );
  19      var $non_db_field_names       = array();
  20      var $non_updatable_attributes = array( 'id' );
  21  
  22      /**
  23       * Sets restriction rules for fields.
  24       *
  25       * @since 2.0.0
  26       *
  27       * @param GP_Validation_Rules $rules The validation rules instance.
  28       */
  29  	public function restrict_fields( $rules ) {
  30          $rules->user_id_should_not_be( 'empty' );
  31          $rules->action_should_not_be( 'empty' );
  32          $rules->object_type_should_be( 'empty' );
  33          $rules->object_id_should_be( 'empty' );
  34      }
  35  }
  36  
  37  GP::$administrator_permission = new GP_Administrator_Permission();


Generated: Sat Dec 14 01:01:05 2024 Cross-referenced by PHPXref 0.7.1