- ⌂ cObject
- Methods
- Constructor
- add_variant()
- approve()
- as_array()
- can_add_variant()
- can_delete_variant()
- can_edit_variant()
- can_reorder_variant()
- clone()
- delete()
- edit_variant()
- enum()
- get_active_object()
- get_all_variants()
- get_attributes()
- get_dimensions()
- get_dimension_with()
- get_parent()
- get_primary_cpath()
- get_variant()
- Keywords()
- lock_object()
- reload_data()
- repo()
- revert()
- save()
- store()
- unlock_object()
- update_from_array()
- validate()
cObject::can_add_variant()
Return TRUE if the current or specified user is authorized to add a variant to this object, otherwise FALSE.
Prototype
boolean can_add_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 add a variant to this object, otherwise FALSE.
Example
// check to see if the current repo user can add a variant
$repo = \comand::repo();
$obj = $repo->get_object_by_oid(123);
$can = $obj->can_add_variant();
echo("User can" . ($can ? "" : "not") . " add variant.\n");