Back to FormController 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
  • 1.6

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   1.6
 */
protected function allowAdd($data = array())
{
    $user = Factory::getUser();
    return $user->authorise('core.create', $this->option) || \count($user->getAuthorisedCategories($this->option, 'core.create'));
}