RController::accessDenied PHP Method

accessDenied() public method

Denies the access of the user.
public accessDenied ( string $message = null )
$message string the message to display to the user. This method may be invoked when access check fails.
    public function accessDenied($message = null)
    {
        if ($message === null) {
            $message = Rights::t('core', 'You are not authorized to perform this action.');
        }
        $user = Yii::app()->getUser();
        if ($user->isGuest === true) {
            $user->loginRequired();
        } else {
            throw new CHttpException(403, $message);
        }
    }