Results 1 to 2 of 2

Thread: How to get logged user object?

  1. #1
    Join Date
    Dec 2010
    Location
    Brno
    Posts
    15

    Default 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. #2
    Join Date
    Dec 2010
    Location
    Brno
    Posts
    15

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •