Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
How to impersonate liferay user using API?
Hi,
I need to impersonate user using JSF portlet.
Please suggest me how to impersonate user using liferay API.
Regards,
Lok
I need to impersonate user using JSF portlet.
Please suggest me how to impersonate user using liferay API.
Regards,
Lok
I have the same problem.
Anyone has a solution?
Anyone has a solution?
To impersonate user outside from Control Panel you just need to generate "magic" parameter (doAsUserId=) which contains encrypted target user id. I used liferay-security tag for that:
You can manually "encrypt" paroper parameter value, just look for examples in com.liferay.taglib.security.DoAsURLTag sources :-)
Real user needs to have permission to impersonate. This can be defined in custom role (regular) with portal permission User: Impersonate: scope=portal
<liferay-security:doasurl doAsUserId="${command.doAsUserId}" var="impersonateUserURL" />
You can manually "encrypt" paroper parameter value, just look for examples in com.liferay.taglib.security.DoAsURLTag sources :-)
Real user needs to have permission to impersonate. This can be defined in custom role (regular) with portal permission User: Impersonate: scope=portal
Hi,
I want to update some data in table when the impersonation happens.Any idea on this.
regard
neha
I want to update some data in table when the impersonation happens.Any idea on this.
regard
neha
Igor Popik:
To impersonate user outside from Control Panel you just need to generate "magic" parameter (doAsUserId=) which contains encrypted target user id. I used liferay-security tag for that:<liferay-security:doasurl doAsUserId="${command.doAsUserId}" var="impersonateUserURL" />
You can manually "encrypt" paroper parameter value, just look for examples in com.liferay.taglib.security.DoAsURLTag sources :-)
Real user needs to have permission to impersonate. This can be defined in custom role (regular) with portal permission User: Impersonate: scope=portal
Can you elaborate how to use this within the context of a portlet form?
I'm trying to create a list of users in a select box and on change, initiate the impersonation of that user.
Thanks in advance.