Fórum

MyaccountURL for other users in Liferay6.2

thumbnail
Raveen Raj, modificado 9 Anos atrás.

MyaccountURL for other users in Liferay6.2

New Member Postagens: 9 Data de Entrada: 04/12/14 Postagens Recentes
Hi,

Am displaying all the list of users available in Portal. As a admin role i should have the access to update all others profile. So how could i get the MyAccountURL for all the users available. Am able to get the url for the user who logged in currently by

ThemeDisplay td = (ThemeDisplay) request
.getAttribute(WebKeys.THEME_DISPLAY);
td.getURLMyAccount()


in the same way i should get the link for all the users.
thumbnail
Suresh Nimmakayala, modificado 9 Anos atrás.

R: MyaccountURL for other users in Liferay6.2

Liferay Master Postagens: 690 Data de Entrada: 18/08/04 Postagens Recentes
As a admin role How In control panel you manage users and organisations same like that ?

Sent from my iPhone with Liferay.com Forums
thumbnail
Raveen Raj, modificado 9 Anos atrás.

RE: R: MyaccountURL for other users in Liferay6.2

New Member Postagens: 9 Data de Entrada: 04/12/14 Postagens Recentes
yes same as like that.. Our requirement is, we have a role MANAGER, and also we have a page display the list of all the users available. When MANAGER loggen in he should be able to access all other users profile and e should be able to update. So here i need to display the List of users available and should provide the link to update their profile..


Some think like this...
<a href="link to raj's myAccount page">Raj</a>
<a href="link to ram's mYAccount page">Ram</a>
<a href="link to ravi's myAccount page">Rvij</a>
thumbnail
Suresh Nimmakayala, modificado 9 Anos atrás.

RE: R: MyaccountURL for other users in Liferay6.2

Liferay Master Postagens: 690 Data de Entrada: 18/08/04 Postagens Recentes
check liferay source code /portal-web/docroot/html/portlet/users_admin/user_action then you will get an idea
thumbnail
Raveen Raj, modificado 9 Anos atrás.

RE: R: MyaccountURL for other users in Liferay6.2

New Member Postagens: 9 Data de Entrada: 04/12/14 Postagens Recentes
Thanks.. i checked it but still am getting null for the UserSearch

UserSearch searchContainer = (UserSearch)request.getAttribute("liferay-ui:search:searchContainer");
String redirect = searchContainer.getIteratorURL().toString();

Am not getting the userSearch class in Liferay6.2.. Anny idea on this?
thumbnail
Suresh Nimmakayala, modificado 9 Anos atrás.

RE: MyaccountURL for other users in Liferay6.2

Liferay Master Postagens: 690 Data de Entrada: 18/08/04 Postagens Recentes
Hi Raj,

before you write own portlet and achieve same goal, check if you can achieve Liferay permissions architecture



you can create a role , define permissions to update and assign role to the Manager users and access to controlpanel to edit users



getting liferay users use UserLocalserviceutil.search method check searchcontainer

then create link for the users so the link to go to edit user page in controlpanel

try something like this, i didn't tried give a try


Group controlPanelGroup = GroupLocalServiceUtil.getGroup(companyId, GroupConstants.CONTROL_PANEL);
long controlPanelPlid = LayoutLocalServiceUtil.getDefaultPlid(controlPanelGroup.getGroupId(), true);

PortletURL edituserURL = PortletURLFactoryUtil.create(request, PortletKeys.USERS_ADMIN, controlPanelPlid, PortletRequest.RENDER_PHASE);
edituserURL.setParameter("struts_action", "/users_admin/edit_user");
String currentURL = PortalUtil.getCurrentURL(request);
edituserURL.setParameter("redirect", currentURL);
edituserURL.setParameter("p_u_i_d", userId);
thumbnail
Raveen Raj, modificado 9 Anos atrás.

RE: MyaccountURL for other users in Liferay6.2

New Member Postagens: 9 Data de Entrada: 04/12/14 Postagens Recentes
Hi Suresh,

Thanks..it worked. I tried like this.. It is poping up the My account page, but gives the error as "You do not have the roles required to access this portlet." The logged in user has the Admin rights but still am getting the issue... Suggest me if am wrong anywhere??

Group controlPanelGroup = GroupLocalServiceUtil.getGroup(td.getCompanyId(), GroupConstants.CONTROL_PANEL);
long myAccountPlId = LayoutLocalServiceUtil.getDefaultPlid(controlPanelGroup.getGroupId(), true);
System.out.println("myAccountPlId " +myAccountPlId);
PortletURL userURL = PortletURLFactoryUtil.create(request, PortletKeys.MY_ACCOUNT, myAccountPlId, PortletRequest.RENDER_PHASE);
userURL.setParameter("struts_action", "/users_admin/edit_user");
String currentURL = PortalUtil.getCurrentURL(request);
userURL.setParameter("redirect", currentURL);
userURL.setParameter("p_u_i_d", String.valueOf(12521));
thumbnail
Suresh Nimmakayala, modificado 9 Anos atrás.

RE: MyaccountURL for other users in Liferay6.2

Liferay Master Postagens: 690 Data de Entrada: 18/08/04 Postagens Recentes
did you see any message in server log ?you are accessing MY_ACCOUNT portlet should be USERS_ADMIN
thumbnail
Raveen Raj, modificado 9 Anos atrás.

RE: MyaccountURL for other users in Liferay6.2

New Member Postagens: 9 Data de Entrada: 04/12/14 Postagens Recentes
i need to give access only to MyAccount page hence using MY_ACCOUNT, if i use USERS_ADMIN it is giving entire access to the control pannel.. that i dont want...