webCOMAND

cObject::can_reorder_variant()

Return TRUE if the current or specified user is authorized to reorder the variants for this object, otherwise FALSE.

Prototype

boolean can_reorder_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 edit a variant to this object, otherwise FALSE.

Example

// see if the current repo user can reorder this object's variants
$repo = \comand::repo();
$obj = $repo->get_object_by_oid(123);
$can = $obj->can_reorder_variant();
echo("User can" . ($can ? "" : "not") . " reorder object variants.\n");

Related

can_add_variant(), can_delete_variant(), can_edit_variant()