Getting details for user viewed on profile page
Now here's a tough one:
I'm currently working on a custom component extending the View User Profile page with links to a few internal tools. (This component of course will only be visible to certain user ranks). Now the challenge is that I need to get hold of the SSO id of the user profile I am currently viewing. The "user" context object obviously only holds the information of the user currently logged in and browsing other user's profiles.
Do I really need to somehow pull the SSO id from the XHTML structure of the document?
I see the problem that a "vieweduser" context object only makes sense on this very "View User Profile" page, alas it would allow some nice custom components for this very page, e.g. more visual stats based on viewed user's data etc.
Unfortunately not :( That takes me back to the 303 error.
But reading a bit further into the UserReference class in the REST API JavaDoc I think this should be the way to go<#assign viewed_sso_id = restadmin("/users/id/${page.context.user.id}/ref/sso_id").value />
At least http://community.lithium.com/my-community/restapi/vc/users/id/8/ref/sso_id in the browser shows a more friendlier 303 error then:
UserRef[id=-1] does not have access to RequiredPermissions[(allow_manage_users)] on CommunityByDisplayIdRef
But executed as restadmin Freemarker call in my custom component then shows yet another discouraging 303:
The object 'User ....' inherently does not support the action 'sso.action'
Guess I need to work on some other component first to get the head free again :(