Restrict access to Smart Link add form.
CRUD permissions were generated when the module was created.
Check user access
$form = \Drupal::formBuilder()->getForm(SmartLinkCreateForm::class);
$form['#access'] = \Drupal::currentUser()->getAccount()
->hasPermission('create smart link');
Topics