Back to ApiController class

Method allowAdd

protected bool
allowAdd
(mixed $data = array())
Method to check if you can add a new record.
Parameters
  • array $data An array of input data.
Returns
  • bool
Since
  • 4.0.0
Class: ApiController
Project: Joomla

Method allowAdd - Source code

/**
 * Method to check if you can add a new record.
 *
 * Extended classes can override this if necessary.
 *
 * @param   array  $data  An array of input data.
 *
 * @return  boolean
 *
 * @since   4.0.0
 */
protected function allowAdd($data = array())
{
    $user = $this->app->getIdentity();
    return $user->authorise('core.create', $this->option) || \count($user->getAuthorisedCategories($this->option, 'core.create'));
}