Skip to main content

Platform Preferences

Platform wide settings can be configured using Preferences in Frontier. These preferences are stored in the database and are applied to all the users of the platform. Since these settings are crucial to the platform, only the platform admin can set these settings. In case the preferences are not set, the default values are used.

The settings can be set using the preferences CLI or the API as described below.

Note: The Frontier backend predefines some settings which are used by the platform. These settings are defined in the default traits of Frontier. The platform admin can override these settings by setting the same setting name using the preferences CLI or the API.

For example, the disable_orgs_on_create setting is defined in the default traits of Frontier. This setting is used by the platform to make the default state of new organizations in Frontier to be disabled. The platform admin can override this setting by setting the same setting name using the preferences CLI or the API.

Usage

Create and Update Preferences

## Syntax
$ frontier preferences set -n <name> -v <value>
$ frontier preferences set --name <name> --value <value>

## Example
$ frontier preferences set -n disable_orgs_on_create -v true -H X-Frontier-Email:user@raystack.org

Note: The setting name is case sensitive.

List Preferences

Once the preferences are set, they can be listed using the following command:

$ frontier preferences list

Describe Preferences

The Preference traits are defined in the Frontier backend to be used by the platform. Only these traits can be used to set the platform wide preferences. The platform admin can view the default traits defined in Frontier using the following command:

 $  frontier preferences get

This command will list all the default traits defined in Frontier. The traits with app/platform namespace denotes the platform wide traits. Similarly, the traits with app/user, app/organization and app/group namespace denotes the user, organization and group wide traits respectively.

Platform Traits

All the trait description, default value and usage can be found with the above command. Just a brief description of the platform wide traits is given below. The input hints show the kind of values that can be provided for the trait separated by a comma. The default value is shown in bold.

Usage and Description of Frontier Traits

NameNamespaceDescriptionInput Hints
disable_orgs_on_createapp/platformIf selected the new orgs created by members will be disabled by default.This can be used to prevent users from accessing the org until they contact the admin and get it enabled."true,false"
disable_orgs_listingapp/platformIf selected will disallow non-admin APIs to list all organizations on the platform."true,false"
disable_users_listingapp/platformIf selected will will disallow non-admin APIs to list all users on the platform"true,false"
invite_with_rolesapp/platformAllow inviting new members with set of role ids. When the invitation is accepted, the user will be added to the org with the roles specified."true,false"
invite_mail_template_subjectapp/platformThe subject of the invite mail sent to new members
invite_mail_template_bodyapp/platformThe body of the invite mail sent to new members