Guidance or experience on using Directus as an admin portal

Hi all!

I’ve been using Directus for a while to develop my own backends and it’s been pretty good. But now I would like to try a new use-case and I am running into some trouble.

I have a platform that is already up and running, and I would like to deploy Directus as a backoffice. However, to preserve the stability of the platform, the platform should be fully responsible for schemas. I just want to add Directus on top of that.

So what I did was I created a new directus role in postgres as well as a directus schema. Then only granted usage rights on the public schema. (see scripts below).

So far so good: I can see my schemas, directus migration runs properly and I can work with my data. But then I ran into my first issue: relations.

When I want to set up a one-to-many relation for display purposes, directus will try to drop the current foreign key constraint and recreate it. Of course, it does not have rights for that. So this process fails.

Is there a different setup to achieve my goals here? (To have an admin backoffice that doesn’t touch the schema, only the data). Or am I trying to do something that isn’t really supported my Directus?

The error I run into when I create a new one-to-many field:

Attachment 1: rights script

CREATE ROLE directus LOGIN PASSWORD 'directus';

-- create the directus database
CREATE SCHEMA directus AUTHORIZATION directus;
ALTER ROLE directus SET search_path = 'directus,public';

-- grant usage rights on main database
GRANT CONNECT ON DATABASE development TO directus;
GRANT USAGE ON SCHEMA public TO directus;
REVOKE CREATE ON SCHEMA public FROM directus;
GRANT SELECT, INSERT, UPDATE, DELETE
    ON ALL TABLES IN SCHEMA public
    TO directus;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
    GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO directus;
GRANT USAGE, SELECT, UPDATE
    ON ALL SEQUENCES IN SCHEMA public
    TO directus;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
    GRANT USAGE, SELECT, UPDATE ON SEQUENCES TO directus;

Attachment 2: development config (.env)

KEY=development signing key
SECRET=development signing secret
DB_CLIENT=postgres
DB_HOST=localhost
DB_PORT=5432
DB_DATABASE=development
DB_USER=directus
DB_PASSWORD=directus
DB_SEARCH_PATH=directus,public
ADMIN_PASSWORD=admin
PROJECT_OWNER=admin@example.com
ACCEPT_TERMS=true
EXTENSIONS_AUTO_RELOAD=true