Directus / @directus/sdk / rest / createPermissions
Function: createPermissions() ​
createPermissions<
Schema,TQuery>(items,query?):RestCommand<IfAny<Schema,Record<string,any>, { [K in string | number | symbol]: Merge<MappedFunctionFields<Schema, UnpackList<IfAny<Schema, { action: ...; collection: ...; fields: ...; id: ...; permissions: ...; policy: ...; presets: ...; validation: ... }, (...) extends (...) ? (...) : (...)>>> extends FF ? MapFlatFields<UnpackList<IfAny<Schema, { action: ...; collection: ...; fields: ...; id: ...; permissions: ...; policy: ...; presets: ...; validation: ... }, (...) extends (...) ? (...) : (...)>>, FieldsWildcard<UnpackList<IfAny<(...), (...), (...)>>, Exclude<UnpackList<(...)>, (...) extends (...) ? (...) : (...)>>, FF extends Record<string, string> ? FF<FF> : Record<string, string>> : never, PickRelationalFields<UnpackList<Mutable<(...)[(...)]>>> extends never ? never : { [Field in string | number | symbol]: Field extends keyof UnpackList<(...)> ? Extract<(...), (...)> extends RelatedCollection ? IsNullable<(...), (...), (...)> : never : never }>[K] }>[],Schema>
Defined in: rest/commands/create/permissions.ts:20
Create multiple new permission rules
Type Parameters ​
• Schema
• TQuery extends Query<Schema, DirectusPermission<Schema>>
Parameters ​
items ​
Partial<DirectusPermission<Schema>>[]
The permission rules to create
query? ​
TQuery
Optional return data query
Returns ​
RestCommand<IfAny<Schema, Record<string, any>, { [K in string | number | symbol]: Merge<MappedFunctionFields<Schema, UnpackList<IfAny<Schema, { action: ...; collection: ...; fields: ...; id: ...; permissions: ...; policy: ...; presets: ...; validation: ... }, (...) extends (...) ? (...) : (...)>>> extends FF ? MapFlatFields<UnpackList<IfAny<Schema, { action: ...; collection: ...; fields: ...; id: ...; permissions: ...; policy: ...; presets: ...; validation: ... }, (...) extends (...) ? (...) : (...)>>, FieldsWildcard<UnpackList<IfAny<(...), (...), (...)>>, Exclude<UnpackList<(...)>, (...) extends (...) ? (...) : (...)>>, FF extends Record<string, string> ? FF<FF> : Record<string, string>> : never, PickRelationalFields<UnpackList<Mutable<(...)[(...)]>>> extends never ? never : { [Field in string | number | symbol]: Field extends keyof UnpackList<(...)> ? Extract<(...), (...)> extends RelatedCollection ? IsNullable<(...), (...), (...)> : never : never }>[K] }>[], Schema>
Returns the permission objects for the created permissions.