You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 40707e8
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: documentation/docs/tutorial/03-Customization/08-pageInjections.md
+25-1Lines changed: 25 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -824,7 +824,31 @@ const term = ref('');
824
824
</script>
825
825
```
826
826
827
-
## List table custom
827
+
## Showing injection only to some users
828
+
829
+
Any resource page injection can have an `isVisible` callback. It is called on the backend every time the resource is loaded, and when it returns `false` the injection is not sent to the frontend, so the user does not see it:
attachFiles: async ({ record }: { record:any }) => {
141
147
//diff-add
@@ -197,6 +203,27 @@ export const admin = new AdminForth({
197
203

198
204
199
205
206
+
## Who can run generation
207
+
208
+
Generation calls a paid AI provider, so it is disabled for all users by default. Set `allowedActions.generate` to choose who can run it. Users who are not allowed don't see the action, and their generation requests are rejected:
`generate:true` allows generation to every user who can see the resource. If `allowedActions.generate` is not set, the plugin logs a warning on startup.
224
+
225
+
Saving the generated values also needs the `edit` permission on the resource and, if set, `isAllowedToSave`.
226
+
200
227
## Text-to-Text Processing
201
228
This is the most basic plugin usage. You can connect any text completion adapter to fill one or several string/number/boolean fields from other fields.
202
229
@@ -209,6 +236,9 @@ import CompletionAdapterOpenAIResponses from '@adminforth/completion-adapter-ope
0 commit comments