skip to main content

Profile and users

Livebase Cloudlet's profile and users.

A profile is an identity defined in the engine of a Cloudlet, which is associated with a Profile Schema that lists its permissions on resources, such as applications and objects. By “user” we mean any user registered with the Cloudlet itself.

Each user can only be assigned one profile, giving them all the permissions defined in the associated Profile Schema.

Regular users and default member #

In Livebase, users of a Cloudlet are instances of the __User platform class and live within the Cloudlet Database. The moment this is first generated, a default member is created with the same username and password as the Livebase account currently in use and is assigned the Member profile, which grants full access to all classes in the model except for the __User class. If the database is emptied or deleted, you can create the default member again by first clicking on the and then the Create Member button.

Members of the cloudlet

Create member

Enabling new users #

In order to enable other users to access the Cloudlet, you need to perform these steps:

  • make the __User class visible in the model: this requires including it in the Database Schema and enabling it in at least one application view;
  • grant user creation privileges to at least one of the defined profiles.

The first two steps are detailed in the Create the __User class section of the __User class, respectively, and in the Rights of the __User Class section of the Rights (grant) section. The following section details the procedure for logging in and creating new users from GraphQL.

Creating Users via GraphQL #

Log in to the Dashboard and start a Cloudlet with GraphQLs enabled (see the section Enable GraphQL API generation).

Submit the following mutation of type create by providing the authentication token of a user with creation permissions on the __User class, thus:

mutation {
  _User___create(data : {
    username : <newUserName>,
    profile : <newUserProfile>,
    email : <newUserEmail>
  }) {
    _id
  }
}

The username, profile, and email fields must be filled in with the username, the profile to be assigned, and the new user’s reference email, respectively. You must also specify a list of selection fields, which are the fields of the newly created object that you want to be shown in the response. In the example, only the _id field has been requested.

If the operation is successful, you get a response like the one shown in the figure, and the link to set the password is sent to the specified email address.

{
  "data": {
    "_User___create": {
      "_id": <newUserId>
    }
  }
}