webCOMAND

cObject::can_delete_variant()

Return TRUE if the current or specified user is authorized to delete a variant for this object, otherwise FALSE.

Prototype

boolean can_delete_variant(User $user = NULL, boolean $force = FALSE)

Parameters

  • user - Optional User to check authorizations for.  If not specified, the current user associated with the repository will be used.
  • force - Optionally set to TRUE to force the user authorization to be reloaded instead of using a potentially cached user authorization.

Return

TRUE if the current or specified user is authorized to delete a variant to this object, otherwise FALSE.

Example

// check to see if the current repo user can edit a variant
$repo = \comand::repo();
$obj = $repo->get_object_by_oid(123);
$can = $obj->can_delete_variant();
echo("User can" . ($can ? "" : "not") . " delete variant.\n");

Related

can_add_variant(), can_edit_variant()