Child pages
  • Manage your users
Skip to end of metadata
Go to start of metadata

Built-in user directory

When you create an Apstrata application, you automatically get a user directory, where you can create users and groups. A user of your application is defined by a login (username), a password and a name, which are mandatory fields. Other fields are also available but not required, such as the email or the groups the user belongs to and you are free to add as many custom fields as you need.

Creating users is done by invoking the SaveUser API, retrieve information on a specific user by calling the GetUser API or run sophisticated queries on your users through the invocation of ListUsers.

Using Apstrata's flexible and powerful authorization mechanisms, you can specify what content your users have access to, and what scripts they are able to execute. In addition, whenever you think that a set of users should have the same authorizations, you can create groups in your application and add those users to the group.

Back to the map   Next station: log in your users

Example 1: register a new player

In the mobile game that you are developing, you would like to allow your players to register as users so you can provide registered players with more content and/or game options, which are not accessible to unregistered users. In order to create a new user in your Apstrata user directory, all you need to do is invoke the SaveUser API that will automatically apply validation rules on the data that is sent and detect any duplicates.

 

Navitabs License Error

The number of licensed users is incompatible with the number of licensed users of Confluence. Please contact your system administrator.

License Details
Try it!

Example 2: allow players to specify the type of games they prefer

In order to improve your users' experience, assume that you decide to allow them to specify their preferences in terms of game types (e.g. arcade, puzzles, card games, etc.) and that you need to store this information in their user profile. Once again, we can resort to the SaveUser API and pass it the "preference" parameter, which is a custom field that you define and that will be added to the user profile. Notice that when updating an existing profile, you need to pass the "apsdb.update" parameter set to "true".

 

Navitabs License Error

The number of licensed users is incompatible with the number of licensed users of Confluence. Please contact your system administrator.

License Details
Try it!

Example 3: find all players who are interested in puzzles

Building on the preceding example, you might need to get the list of all players that are interested in puzzles so you can promote about your brand new puzzle game. So let us see how to do this:

 

Navitabs License Error

The number of licensed users is incompatible with the number of licensed users of Confluence. Please contact your system administrator.

License Details
Try it!

Dig deeper

Related tutorials