Announcement Announcement Module
Collapse
No announcement yet.
How to get logged user object? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to get logged user object?

    Hi,
    I'm playing with Slingshot - I used Slingshot's UserFactory, sample/login against alfresco works, but I don't know how to get SlingshotUser object in my Java code. How can I do that?

    Thanks in advance!

  • #2
    Ok, nevermind :-).
    It's possible to inject myUserFactory into webscript
    Code:
    <bean id="webscript.webscripts.pokus.get" class="cz.mis.webscript.Pokus" parent="webscript">
    		<property name="misUserFactory" ref="webframework.factory.user.mis"/>
    	</bean>
    and in myUserFactory it's possible to get userId like
    Code:
    RequestContext context = (RequestContext)ThreadLocalRequestContext.getRequestContext();
        	String currentUserId = context.getUserId();
    so in webscript I can get userId.

    Comment

    Working...
    X