public function can($permissionName, $params = [], $allowCaching = true)
{
// check for auth manager to call parent
$auth = Yii::$app->getAuthManager();
if ($auth) {
return parent::can($permissionName, $params, $allowCaching);
}
// otherwise use our own custom permission (via the role table)
/** @var \amnah\yii2\user\models\User $user */
$user = $this->getIdentity();
return $user ? $user->can($permissionName) : false;
}