/
users.liquid
77 lines (56 loc) · 3.62 KB
/
users.liquid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
converter: markdown
metadata:
title: "[DEPRECATED] Users"
description: A User is an account that any of your users can have. Each user is assumed to have a unique email address.
---
{%- capture content -%}This article series promote UserProfiles and Forms, which are deprecated. We decided to reduce the learning curve by promoting explicit implementation via Liuid, Pages and GraphQL, instead of a built-in features, which add magic into the mix and hence increase the learning curve and makes debugging harder. Please refer to our [Get Started](/get-started) to read up-to date articles, including [User Authentication](/get-started/build-your-first-app/user-authentication){%- endcapture -%}{%- render 'alert/deprecated', content: content -%}
A **User** is an account that any of your users can have. Each user is assumed to have a unique email address. You can define properties for all users in the [app/user.yml](developer-guide/platformos-workflow/codebase#users) file.
**User Profiles** are roles in your application. Each User Profile can be associated with any number of Properties, Images, Attachments, and Tables.
## Sharing attributes across multiple profiles
If your multiple profiles happen to have the same Properties, you can extract them to a container profile which will group them.
### Example
A company has a lot of employees, but all of them have the same attributes like name, email, emergency contact, so it would be a good idea to create a profile for "employee", and then use more specific ones for specific roles in the company.
##### app/user_profile_types/employee.yml
```yaml
name: employee
properties:
- name: name
type: string
- name: email
type: string
- name: emergency_contact
type: string
```
##### app/user_profile_types/software_developer.yml
```yaml
name: software_developer
properties:
- name: programming_languages
type: string
```
##### app/user_profile_types/project_manager.yml
```yaml
name: project_manager
properties:
- name: projects
type: string
```
{% include 'alert/note', content: 'Read more about [sharing attributes across multiple profiles](/developer-guide/users/sharing-attributes-across-multiple-profiles).' %}
## Sign up forms
**Sign up forms** allow users to sign up by entering their information in a form embedded in a page.
All forms should be located in the `app/forms` directory.
{% include 'alert/note', content: 'Check out our [Creating a Sign-Up Form](/developer-guide/users/creating-sign-up-form) page to learn more about sign-up forms.' %}
## User authentication
There are a couple of ways to authenticate a user in platformOS, the most common being through an email and password pair, which the user provided via a sign-up form.
## Related topics
* [Creating a Property for All Users](/developer-guide/users/creating-user-property)
* [Creating a User Profile](/developer-guide/users/creating-user-profile)
* [Creating a Sign-Up Form](/developer-guide/users/creating-sign-up-form)
* [Embedding a Sign-Up Form in a Page](/developer-guide/users/embedding-sign-up-form)
* [Signing In a User Manually](/developer-guide/users/signing-in-user-manually)
* [Signing In a User Automatically after Sign Up](/developer-guide/users/signing-in-user-automatically-after-sign-up)
* [Logging Out an Authenticated User](/developer-guide/users/logging-out-authenticated-user)
* [Resetting Password of an Authenticated User](/developer-guide/users/resetting-password-authenticated-user)
* [Accessing Authenticated User Data](/developer-guide/users/accessing-authenticated-user-data)
* [Sharing Attributes Across Multiple Profiles](/developer-guide/users/sharing-attributes-across-multiple-profiles)