CommonDBTM::canEdit PHP Method

canEdit() public method

Have i right to see action button
public canEdit ( $ID ) : booleen
$ID integer ID to check
return booleen
    function canEdit($ID)
    {
        if ($this->maybeDeleted()) {
            return $this->can($ID, CREATE) || $this->can($ID, UPDATE) || $this->can($ID, DELETE) || $this->can($ID, PURGE);
        }
        return $this->can($ID, CREATE) || $this->can($ID, UPDATE) || $this->can($ID, PURGE);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @see CommonDBTM::processMassiveActionsForOneItemtype()
  **/
 static function processMassiveActionsForOneItemtype(MassiveAction $ma, CommonDBTM $item, array $ids)
 {
     switch ($ma->getAction()) {
         case 'sendmail':
             foreach ($ids as $id) {
                 if ($item->canEdit($id)) {
                     if ($item->sendMailById($id)) {
                         $ma->itemDone($item->getType(), $id, MassiveAction::ACTION_OK);
                     } else {
                         $ma->itemDone($item->getType(), $id, MassiveAction::ACTION_KO);
                     }
                 } else {
                     $ma->itemDone($item->getType(), $id, MassiveAction::ACTION_NORIGHT);
                 }
             }
             return;
     }
     parent::processMassiveActionsForOneItemtype($ma, $item, $ids);
 }
All Usage Examples Of CommonDBTM::canEdit
CommonDBTM