Files
directus/tests/setup/seeds/06_directus_permissions.js
Brainslug 6f2d22704e Field permissions and relational interfaces (#13623)
* quick fix ignoring fields wrapped in $FOLLOW when checking permissions

* checking related permissions for $FOLLOW filter

* moved $FOLLOW logic to extractRequiredFieldPermissions

* initial attempt at making e2e test for this issue

* moved test to many-to-many.test.ts

* added permissions for the test

* created new user and role for these tests

* broadened the expected matching object

* only expecting name as the id field UUID was giving inconsistent uppercased results with mssql
2022-05-31 10:05:40 -04:00

38 lines
787 B
JavaScript

exports.seed = async function (knex) {
await knex('directus_permissions').del();
return await knex('directus_permissions').insert([
// TestUser role permissions
{
role: '214faee7-d6a6-4a4c-b1cd-f9e9bd0b6fb7',
collection: 'guests',
action: 'read',
fields: '*',
},
{
role: '214faee7-d6a6-4a4c-b1cd-f9e9bd0b6fb7',
collection: 'directus_roles',
action: 'read',
fields: '*',
},
{
role: '67ce831d-7a02-4a06-a8c9-c8ea16d71e91',
collection: 'artists',
action: 'read',
fields: 'id,name',
},
{
role: '67ce831d-7a02-4a06-a8c9-c8ea16d71e91',
collection: 'artists_events',
action: 'read',
fields: '*',
},
{
role: '67ce831d-7a02-4a06-a8c9-c8ea16d71e91',
collection: 'events',
action: 'read',
fields: '*',
},
]);
};