javascript - name of current user?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2009 04:38 AM
Sounds like a simple question:
In Javascript: how do I find out the name of the currently logged in user?
I tried with the root objects "person" and "session" but couldn't get name out of them…
Thx
fx3000se
In Javascript: how do I find out the name of the currently logged in user?
I tried with the root objects "person" and "session" but couldn't get name out of them…
Thx
fx3000se
Labels:
- Labels:
-
Archive
8 REPLIES 8
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2009 05:45 AM
If you're after username, then it's
Mike
person.properties.userName
Thanks,Mike

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2010 03:29 PM
When i use this with my UI Action, the person what is return is only Admin.
Anybody know's why?
Thanks
Anybody know's why?
Thanks

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2010 04:24 PM
Sorry. I found the problem.
ops:


Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2010 04:55 PM
I have the same problem! Can you help me to understand it?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2011 07:52 AM
I am always getting "admin" when I execute
person.properties.userName;
Can you plz help.
person.properties.userName;
Can you plz help.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2011 08:08 AM
Dear Folks,
I am also getting the same issue.
I always get the admin as current logged in User even though I am logging as normal user.
Please help me with the issue.
Thanks!
-Nirvan
I am also getting the same issue.
I always get the admin as current logged in User even though I am logging as normal user.
Please help me with the issue.
Thanks!
-Nirvan
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2011 02:47 AM
Hi,
I am using alfresco v 3.4.3 and I have tried to replicate your scenario where in I have created a webscript which will just fetch me the current user name.
Below is the reference code :
1. xyz.get.js file
2. xyz.get.json.ftl file
3. xyz.get.desc.xml file - description file
This is giving me the correct logged in user.
One probable reason I could think of is - admin user must be in browser history/Cache. You may try clearing the browser history and see if it works or not.
Please share if you found the root cause of why person.properties.userName always gives you the admin user.
Thanks,
I am using alfresco v 3.4.3 and I have tried to replicate your scenario where in I have created a webscript which will just fetch me the current user name.
Below is the reference code :
1. xyz.get.js file
function main(){ model.currentUserDetails = person.properties.userName;}main();
2. xyz.get.json.ftl file
{ "userName":"${currentUserDetails}" }
3. xyz.get.desc.xml file - description file
<webscript> <shortname>CurrentUser</shortname> <url>/api/user/currentuser</url> <format default="json"/> <authentication>user</authentication><transaction allow="readonly">required</transaction></webscript>
This is giving me the correct logged in user.
One probable reason I could think of is - admin user must be in browser history/Cache. You may try clearing the browser history and see if it works or not.
Please share if you found the root cause of why person.properties.userName always gives you the admin user.
Thanks,
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2015 08:34 AM
i tried person.properties.username
but it always gives "admin"
if anyone solved this
please help me
Thanks in advance
but it always gives "admin"
if anyone solved this
please help me
Thanks in advance
