Exemplo n.º 1
0
 /**
  * Overrides BundlableLabelableBaseModelWithAttributes:isSaveable to implement system list access restrictions
  */
 public function isSaveable($po_request, $ps_bundle_name = null)
 {
     if (parent::isSaveable($po_request, $ps_bundle_name)) {
         // user could save this list
         if ($this->getPrimaryKey()) {
             if ($this->get('is_system_list')) {
                 if (!$po_request->user->canDoAction('can_edit_system_lists')) {
                     return false;
                 }
             }
         }
         return true;
     } else {
         // BundlableLabelableBaseModelWithAttributes:isSaveable returned false
         // => user can't edit this list at all, no matter how is_system_list is set
         return false;
     }
 }