/** * Method to authorise a user action. * * @param string $action The action to authorise. * @param mixed $user The (optional) user to authorise. * * @return boolean True if authorised, false otherwise. * * @since 12.1 */ public function authorise($action, JAuthorisationRequestor $user = null) { return $this->authoriser->setRules($this->getRules())->isAllowed($action, $user ? $user : $this->user); }
/** * Method to authorise a user action. * * @param string $action The action to authorise. * @param mixed $user The (optional) user to authorise. * * @return mixed True if allowed, false for an explicit deny, null for an implicit deny. * * @since 12.1 * @throws LogicException */ public function authorise($action, JAuthorisationRequestor $user = null) { // Assert the object is loaded. $this->assertIsLoaded(); return $this->authoriser->setRules($this->getRules())->isAllowed($action, $user ? $user : $this->user); }