-
Book Overview & Buying
-
Table Of Contents
Mastering RethinkDB
By :
If you are using Horizon's Authentication system and not any third party authentication, such as Facebook, Twitter, and so on, user information is stored in a special Horizon collection called users.
You can use the user's collection either by loading it similarly to other collections, or access it directly as shown in the following code:
const horizon = Horizon();
// Access as a standard collection
const users = horizon('users');
// Access through the shortcut
const users = horizon.users;
Note: Third-party authentication is not in the scope of this chapter, however you can learn about it here http://horizon.io/docs/auth/.
When a new user is created, Horizon assigns it two user groups, which are:
Default: Rules for all the users
Authenticated: Rules for those users who are authenticated by the system
These user groups are used to assign permission to the user. A typical document in the users collections looks like this:
{
"id":...