I have limited experience with the Angular SDK and lb-service, and I'm unsure about how to retrieve another user's information by their ID within a controller.
I am trying to implement a feature for displaying a friend list, where each user only stores the IDs of their friends. The account properties are defined as follows:
"name": "account",
"base": "User",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"email": {
"type": "string",
"required": true
},
"password": {
"type": "string",
"required": true
},
"firstName": {
"type": "string",
"required": true
},
"lastName": {
"type": "string",
"required": true
},
"gender": {
"type": "string",
"required": true,
"default": "Male"
},
"contact": {
"type": "number"
},
"friends": {
"type": [
"string"
]
},
"status": {
"type": "string"
}
}
},
"acls": [
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
},
{
"accessType": "*",
"principalType": "ROLE",
"principalId": "$owner",
"permission": "ALLOW"
},
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$unauthenticated",
"permission": "DENY"
},
{
"accessType": "*",
"principalType": "ROLE",
"principalId": "admin",
"permission": "ALLOW"
}
]
In the lb-services.js file, it seems that I can use the findById function to locate a user, but I am curious about how to query a friend's properties in order to obtain each user's information.