AI Chatbot: Add role permission per AI Assistant
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3484552. -->
Reported by: [marcus_johansson](https://www.drupal.org/user/385947)
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>Currently we have the issues that the assistant might be available to anyone if you do a misconfiguration in the AI Chatbot block or some other interface.</p>
<p>Different assistants have very different permission levels, so it should also be that the assistants can have their own role permission levels, so certain roles can only run certain assistants.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Add a choice of roles in the configuration of AI Assistants<br>
Add a public get method, so interfaces can act based on this.<br>
Apply that permissions check in the beginning of the process method of the AIAssistantRunner.<br>
Create an update hook that gives the current assistants permission to all roles.</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<h3 id="summary-ui-changes">User interface changes</h3>
<h3 id="summary-api-changes">API changes</h3>
<h3 id="summary-data-model-changes">Data model changes</h3>
issue