diff --git a/backend/README.md b/backend/README.md index 8ba6775b..94154126 100644 --- a/backend/README.md +++ b/backend/README.md @@ -13,7 +13,6 @@ npx directus-sync push \ --directus-password admin123 ./seed.sh - ``` ## Pull Data from Docker to Harddrive @@ -42,7 +41,6 @@ npx directus-sync push \ In order to seed the development data, run the script `backend/seed.sh`. - ## Backup Database Either keep a copy of the `/data/database` folder or run the following command to get an sql dump diff --git a/backend/directus-config/collections/permissions.json b/backend/directus-config/collections/permissions.json index 0e5385be..9bfaee77 100644 --- a/backend/directus-config/collections/permissions.json +++ b/backend/directus-config/collections/permissions.json @@ -1697,7 +1697,7 @@ "permissions": null, "validation": null, "presets": { - "role": "cccbc503-ecab-4ef1-8cf9-b6ac0f2be240" + "role": "REPLACEME-WITH-REGISTRATED-ROLE_UUID" }, "fields": [ "first_name", diff --git a/backend/directus-config/collections/policies.json b/backend/directus-config/collections/policies.json index 7d529236..cdee0aff 100644 --- a/backend/directus-config/collections/policies.json +++ b/backend/directus-config/collections/policies.json @@ -93,7 +93,7 @@ "app_access": false, "roles": [ { - "role": "9865ace7-27fe-4d1f-be88-99ee6410fca2", + "role": "role-registrated", "sort": 1 } ], diff --git a/backend/directus-config/collections/roles.json b/backend/directus-config/collections/roles.json index d5de88d1..e629e6c0 100644 --- a/backend/directus-config/collections/roles.json +++ b/backend/directus-config/collections/roles.json @@ -11,7 +11,7 @@ "icon": "paragliding", "description": null, "parent": null, - "_syncId": "9865ace7-27fe-4d1f-be88-99ee6410fca2" + "_syncId": "role-registrated" }, { "name": "Editor", diff --git a/backend/directus-config/seed-manual/seed.sh b/backend/directus-config/seed-manual/seed.sh deleted file mode 100755 index 087f2abb..00000000 --- a/backend/directus-config/seed-manual/seed.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# base setup -SCRIPT_PATH=$(realpath $0) -SCRIPT_DIR=$(dirname $SCRIPT_PATH) - -SEED_SQL_DIR=$SCRIPT_DIR/sql - -# apply database updates -for filename in $SEED_SQL_DIR/*.sql; do - docker exec -i utopia-map-database-1 /bin/bash -c "PGPASSWORD=directus psql -v ON_ERROR_STOP=1 --username directus directus" < $filename -done \ No newline at end of file diff --git a/backend/directus-config/seed-manual/sql/branding-logo.sql b/backend/directus-config/seed-manual/sql/branding-logo.sql deleted file mode 100644 index e9efc137..00000000 --- a/backend/directus-config/seed-manual/sql/branding-logo.sql +++ /dev/null @@ -1 +0,0 @@ -UPDATE public.directus_settings SET project_logo = (SELECT id FROM directus_files WHERE filename_download = 'utopia-logo.svg'); diff --git a/backend/directus-config/seeds/.gitignore b/backend/directus-config/seeds/.gitignore index eb9ad4c4..63cbc6fc 100644 --- a/backend/directus-config/seeds/.gitignore +++ b/backend/directus-config/seeds/.gitignore @@ -1,3 +1,3 @@ -* +/* !development/ !.gitignore \ No newline at end of file diff --git a/backend/directus-config/seeds/development/manual/register-role.sql b/backend/directus-config/seeds/development/manual/register-role.sql new file mode 100644 index 00000000..ee86ea21 --- /dev/null +++ b/backend/directus-config/seeds/development/manual/register-role.sql @@ -0,0 +1,5 @@ +UPDATE public.directus_permissions + SET presets = jsonb_set(presets::jsonb,'{role}', to_jsonb((SELECT id FROM public.directus_roles WHERE name = 'Registrated')), true) + WHERE policy = (SELECT id FROM public.directus_policies WHERE name = '$t:public_label') + AND collection = 'directus_users' + AND action = 'create'; \ No newline at end of file