コード例 #1
0
ファイル: ca_lists.php プロジェクト: ffarago/pawtucket2
 /**
  * Overrides BundlableLabelableBaseModelWithAttributes:isDeletable to implement system list access restrictions
  */
 public function isDeletable($po_request)
 {
     if (parent::isDeletable($po_request)) {
         // user could delete this list
         if ($this->getPrimaryKey()) {
             if ($this->get('is_system_list')) {
                 if (!$po_request->user->canDoAction('can_delete_system_lists')) {
                     return false;
                 }
             }
         }
         return true;
     } else {
         // BundlableLabelableBaseModelWithAttributes:isDeletable returned false
         // => user can't delete this list at all, no matter how is_system_list is set
         return false;
     }
 }