context: MorphGlobalContext
.
User information is stored in the user_info
variable of this context
.
The type of the context.user_info
variable is as follows:
Variable | Description | Type |
---|---|---|
user_id | User ID | str |
email | User’s email address | str |
username | User’s name | str |
first_name | User’s first name | str |
last_name | User’s last name | str |
roles | User’s project roles | list[str] |
roles
variable in the context.user_info
variable stores the user’s project roles.
Project roles are roles that can be set for users in each project. They can be set in the “Member Access” tab of the project details.
context.user_info
.
/path/to/project/.mock_user_context.json
file and save the value in the same type as the above JSON, then the value of context.user_info
will be automatically switched.
You can implement role-based access control by changing the setting value of roles
.