Can I activate my plugin only for those registered on the site?

So do I understand that a command is enough, or do I have to add some parameters?

    const currentUser = this.currentUser;
    if (!currentUser) {
      return;
    }