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 Authentication, Deployment, Project, User and group, v19 R5, v20

Latest related posts

  • April 29, 2025

    Discover your AI-powered writing assistant in 4D Write Pro

  • April 28, 2025

    Unlock the Power of AI with 4D AIKit: Automate, Create, and Innovate

  • April 25, 2025

    Formulas in Label Wizard

Avatar
Damien Fuzeau
• Product Owner •Damien Fuzeau has joined the 4D Product team in February 2019. As a Product Owner, he is in charge of writing user stories, then translating them to functional specifications. His job also entails making sure that the feature implementations delivered are meeting the customer needs.Damien is graduated from the University of Nantes in software engineering. He spent more than 23 years in its former company, first as developer (discovering 4D in 1997), and later as engineering manager and software architect. This company is a 4D OEM partner and deployed 4D based business softwares for thousands users, on hundreds servers. So, Damien is used to 4D development and deployment in a multi-language context.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • 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-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio 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