mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Prevent directus_ collections from being created
This commit is contained in:
@@ -60,6 +60,10 @@ export class CollectionsService {
|
||||
throw new InvalidPayloadException(`The "collection" key is required.`);
|
||||
}
|
||||
|
||||
if (payload.collection.startsWith('directus_')) {
|
||||
throw new InvalidPayloadException(`Collections can't start with "directus_"`);
|
||||
}
|
||||
|
||||
if (await schemaInspector.hasTable(payload.collection)) {
|
||||
throw new InvalidPayloadException(
|
||||
`Collection "${payload.collection}" already exists.`
|
||||
|
||||
Reference in New Issue
Block a user