4D Blog

Home Product Directory file management in merged server projects

Directory file management in merged server projects

April 27, 2022

Product

Projects introduced the new directory.json file containing users, groups and permissions. It allows authentication, restrictions, permissions on several parts of the application, through settings or code. Let’s see the new improvements about this file usage in merged server projects.

Reminder

On a project, the users, groups and some permissions are saved in the directory file. To remind yourself of how it works, you can read this presentation blog-post again or watch this video.

Directory files

The project directory file is the directory.json file located in the project user settings folder (Settings folder next to the Project folder of the project in use):

The data directory file is the directory.json file located in the user settings folder for data (Settings folder next to the data file in use):
blank

The application directory file is the directory.json file located in the application user settings folder (Settings folder inside the Server Database folder of the merged server application):
blank

 

Embed the file during build application process

So far, it was your job to include a directory file in the merged server after build application process. If you don’t include a directory file in the application package or next to the data file, during the execution, all the users are using the Designer account with all its rights.
So to make it safer and easier, from v19R5, a new buildApp key is at your disposal. This key automatically embeds the project directory file in the merged server during the build application process:

<BuildApp>
  <CS>
    <ServerEmbedsProjectDirectoryFile>True</ServerEmbedsProjectDirectoryFile>

Note that this new setting is also available in the Build Application dialog:

blank

Server-side behavior

The current behavior is maintained: the 4D Server loads the data directory file if it exists. Otherwise, the application directory file is loaded.
But from now, in a merged server project, all modifications made to users, groups and permissions during execution are automatically stored in the data directory file. The application directory file is never touched and can be considered as an initialization directory file. This will guarantee your application signature stays safe on macOS, or allow you to place your server application in a read-only folder without any error.
At server startup, if no data directory file exists, the users, groups and permissions stored in the application directory file, if they exist, are loaded. Then, if modifications are performed on users, groups or permissions, they are stored in the data directory file.

Technical accounts

Users and groups are often used as technical accounts by 4D developers. This can be done using the toolbox, or with 4D code by testing the current user name with Current user or the group membership with User in group. In such cases, to make sure these users and groups are persistent, you can check them at server startup, and subsequent modifications will automatically be stored in the data directory file!

Discuss

Tags Deployment, Project, User and group, v19 R5, v20

Latest related posts

  • December 3, 2025

    Give AI to a 30 years old 4D application

  • November 28, 2025

    ORDA – Handle an event-driven logic during database operations

  • November 27, 2025

    ORDA – Permissions – Restrict / allow web access to the resources in one click

Avatar
Damien Fuzeau
- Product Owner - Damien Fuzeau joined the 4D Product team in February 2019. As a Product Owner, he is responsible for writing user stories and translating them into functional specifications. His role also involves ensuring that the delivered feature implementations meet customer needs. Damien holds a degree in Software Engineering from the University of Nantes. He spent over 23 years at his previous company, first as a developer (discovering 4D in 1997), and later as Engineering Manager and Software Architect. The company was an OEM partner of 4D and deployed enterprise software based on 4D for thousands of users across hundreds of servers. Damien is therefore well-versed in 4D development and deployment in multilingual environments.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • AI
  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy