|
34 | 34 | "required": ["name"] |
35 | 35 | }`); |
36 | 36 | let hasPersonalEntity = $state(false); |
| 37 | + let hasPublicAccess = $state(false); |
| 38 | + let hasCommunityAccess = $state(false); |
37 | 39 | let isSubmitting = $state(false); |
38 | 40 | let schemaError = $state(""); |
39 | 41 |
|
|
89 | 91 | properties: schema.properties, |
90 | 92 | }, |
91 | 93 | has_personal_entity: hasPersonalEntity, |
| 94 | + has_public_access: hasPublicAccess, |
| 95 | + has_community_access: hasCommunityAccess, |
92 | 96 | }; |
93 | 97 |
|
94 | 98 | const response = await fetch(`/api/dynamic-entities/system/create`, { |
|
232 | 236 | </div> |
233 | 237 | </div> |
234 | 238 |
|
| 239 | + <!-- Has Public Access --> |
| 240 | + <div> |
| 241 | + <div class="flex items-start"> |
| 242 | + <div class="flex h-6 items-center"> |
| 243 | + <input |
| 244 | + type="checkbox" |
| 245 | + id="hasPublicAccess" |
| 246 | + bind:checked={hasPublicAccess} |
| 247 | + class="h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:ring-offset-gray-800 dark:focus:ring-blue-600" |
| 248 | + /> |
| 249 | + </div> |
| 250 | + <div class="ml-3"> |
| 251 | + <label |
| 252 | + for="hasPublicAccess" |
| 253 | + class="text-sm font-medium text-gray-700 dark:text-gray-300" |
| 254 | + > |
| 255 | + Has Public Access |
| 256 | + </label> |
| 257 | + <p class="mt-1 text-xs text-gray-500 dark:text-gray-400"> |
| 258 | + When enabled, records of this entity type can be accessed publicly |
| 259 | + without authentication. |
| 260 | + </p> |
| 261 | + </div> |
| 262 | + </div> |
| 263 | + </div> |
| 264 | + |
| 265 | + <!-- Has Community Access --> |
| 266 | + <div> |
| 267 | + <div class="flex items-start"> |
| 268 | + <div class="flex h-6 items-center"> |
| 269 | + <input |
| 270 | + type="checkbox" |
| 271 | + id="hasCommunityAccess" |
| 272 | + bind:checked={hasCommunityAccess} |
| 273 | + class="h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:ring-offset-gray-800 dark:focus:ring-blue-600" |
| 274 | + /> |
| 275 | + </div> |
| 276 | + <div class="ml-3"> |
| 277 | + <label |
| 278 | + for="hasCommunityAccess" |
| 279 | + class="text-sm font-medium text-gray-700 dark:text-gray-300" |
| 280 | + > |
| 281 | + Has Community Access |
| 282 | + </label> |
| 283 | + <p class="mt-1 text-xs text-gray-500 dark:text-gray-400"> |
| 284 | + When enabled, records of this entity type can be accessed by any |
| 285 | + authenticated user (community member). |
| 286 | + </p> |
| 287 | + </div> |
| 288 | + </div> |
| 289 | + </div> |
| 290 | + |
235 | 291 | <!-- Schema JSON --> |
236 | 292 | <div> |
237 | 293 | <label |
|
271 | 327 | </li> |
272 | 328 | <li> |
273 | 329 | <strong>type:</strong> Can be "string", "number", "integer", "boolean", |
274 | | - "json", "DATE_WITH_DAY" |
275 | | - </li> |
276 | | - <li> |
277 | | - <strong>required:</strong> Array of required field names (optional) |
| 330 | + "json", "DATE_WITH_DAY" (also "reference:..." types) |
278 | 331 | </li> |
279 | 332 | <li> |
280 | | - <strong>minimum/maximum:</strong> For numeric validation (optional) |
| 333 | + <strong>required:</strong> Array of required field names (must be present, can be empty []) |
281 | 334 | </li> |
282 | 335 | <li> |
283 | 336 | <strong>minLength/maxLength:</strong> For string validation (optional) |
284 | 337 | </li> |
285 | 338 | <li> |
286 | 339 | <strong>example:</strong> Example value for the field (required) |
287 | 340 | </li> |
| 341 | + <li> |
| 342 | + <strong>description:</strong> Human-readable description of the field (optional) |
| 343 | + </li> |
| 344 | + <li> |
| 345 | + <strong>has_personal_entity:</strong> Allow each user to create their own private records (optional, default true) |
| 346 | + </li> |
| 347 | + <li> |
| 348 | + <strong>has_public_access:</strong> Allow unauthenticated public access to records (optional, default false) |
| 349 | + </li> |
| 350 | + <li> |
| 351 | + <strong>has_community_access:</strong> Allow any authenticated user with CanGet role to access ALL records (optional, default false) |
| 352 | + </li> |
288 | 353 | </ul> |
289 | 354 | {#if data.externalLinks?.API_EXPLORER_URL} |
290 | 355 | <div class="mt-3 border-t border-blue-300 pt-3 dark:border-blue-700"> |
|
0 commit comments