123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- /**
- * Define a permission.
- * @author Chuck NORRIS
- * @category Plugin
- * @license copyright
- */
- class Permission extends Entity{
- public $id;
- public $read; //read (Booléen)
- public $recursive; //recursive (Booléen)
- public $uid; //uid (Texte)
- public $entity; //entity (Texte)
- public $configure; //configure (Booléen)
- public $delete; //delete (Booléen)
- public $edit; //edit (Booléen)
- public $targetEntity; //Entité cible (Texte)
- public $targetUid; //uid cible (Texte)
-
- protected $TABLE_NAME = 'permission';
- public $fields = array(
- 'id' => 'key',
- 'read' => 'boolean',
- 'recursive' => 'boolean',
- 'uid' => 'string',
- 'entity' => 'string',
- 'configure' => 'boolean',
- 'delete' => 'boolean',
- 'edit' => 'boolean',
- 'targetEntity' => 'string',
- 'targetUid' => 'string'
- );
- public $links = array(
- );
- //Colonnes indexées
- public $indexes = array();
- //Remplis une permission a partir de la modale de base un d'un form custom
- public static function form($form = null){
- if(!isset($form)){
- global $_;
- $form = $_;
- }
- $item = new self();
- if(isset($form['read']))$item->read = $form['read'];
- if(isset($form['recursive']))$item->recursive = $form['recursive'];
- if(isset($form['uid']))$item->uid = $form['uid'];
- if(isset($form['entity']))$item->entity = $form['entity'];
- if(isset($form['configure']))$item->configure = $form['configure'];
- if(isset($form['delete']))$item->delete = $form['delete'];
- if(isset($form['edit']))$item->edit = $form['edit'];
- if(isset($form['targetEntity']))$item->targetEntity = $form['targetEntity'];
- if(isset($form['targetUid']))$item->targetUid = $form['targetUid'];
- return $item;
- }
- }
- ?>
|