Help understanding Freemarker permissions
- 11 years ago
Hey tyw , The rest call breaks down like this:
/messages/id/${env.context.message.uniqueId?c}/author/profiles/name/carrier/allowed").value
/messages <= look at messages
/id <= look at a specific message by it's ID
/${env.context.message.uniqueId?c} <= look at the message we are currently in (so this component forms part of a post or this will error)
/author <= Now look at the author of the specific post
/profiles <= retrieve details from their profile
/name <= retrieve a specific field by it's name
/carrier/allowed").value <= And here we're retrieving a specific group of fields. "Carrier" and an "Allowed" value under it.
I'd assume this is a list of mobile carriers a user can assign themselves to?
The "allowed" option changes the rest call from a value to a boolean, I think it refers to whether a user can access a field or not.
For one of our random users it returns "true" for a field we have, and "false" for fields we don't have. As an admin you'll see "true" for all fields.
You can retrieve the actual value like this:
http://CommunityUrl/CommunityName/restapi/vc/users/id/UserID/profiles/name/name_first
http://CommunityUrl/CommunityName/restapi/vc/users/id/UserID/profiles/name/carrier
We have a custom field to store the users birthday (as a string in EPOCH) format, but we never included the ability to view, customise or edit it in our original spec... Hopefully you've got more than we got :)
That cover what you're looking for?
REST docs on the profile call over here: http://community.lithium.com/t5/Community-API/bd-p/developers-rest-api?leaf-id=User.profiles#User.profiles
T