<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>How to set the default role when user log in in liferay 6.0 or 6.1</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=19088267" />
  <subtitle>How to set the default role when user log in in liferay 6.0 or 6.1</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=19088267</id>
  <updated>2026-04-04T16:11:16Z</updated>
  <dc:date>2026-04-04T16:11:16Z</dc:date>
  <entry>
    <title>RE: How to set the default role when user log in in liferay 6.0 or 6.1</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=19099498" />
    <author>
      <name>Sreeraj AV</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=19099498</id>
    <updated>2013-01-10T12:49:28Z</updated>
    <published>2013-01-10T12:49:28Z</published>
    <summary type="html">&lt;div class="quote-title"&gt;Kiran Kumar Boyini:&lt;/div&gt;&lt;blockquote&gt;Hi All,&lt;br /&gt;&lt;br /&gt;            I have requirement i.e., When the user logs in we have to assign one role as default role from the available roles related to him.&lt;br /&gt;And he has in role (default role) every time, when he logs.&lt;br /&gt;&lt;br /&gt;Tell me, how it is possible in simplest way.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;&lt;br /&gt;Kiran.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;I didnt get ur question exactly.. One option is, using control panel section. We can set default users associations using &lt;strong&gt;Control Panel -&amp;gt; Portal Settings -&amp;gt; Users -&amp;gt; Default User Associations&lt;/strong&gt; Tab.</summary>
    <dc:creator>Sreeraj AV</dc:creator>
    <dc:date>2013-01-10T12:49:28Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to set the default role when user log in in liferay 6.0 or 6.1</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=19088923" />
    <author>
      <name>Jitendra Rajput</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=19088923</id>
    <updated>2013-01-10T07:12:45Z</updated>
    <published>2013-01-10T07:12:45Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;over ride login.events.post event using hook.  This event will be called after successful login.&lt;br&gt;&lt;br&gt;Specify below entries in your liferay-hook.xml&lt;br&gt;&lt;pre&gt;&lt;code&gt;
&amp;lt;hook&amp;gt;
&amp;lt;event&amp;gt;
&amp;lt;event-class&amp;gt;com.test.sample.CustomLoginPostAction&amp;lt;/event-class&amp;gt;
&amp;lt;event-type&amp;gt;login.events.post&amp;lt;/event-type&amp;gt;
&amp;lt;/event&amp;gt;
&amp;lt;/hook&amp;gt;

&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;And create CustomLoginPostAction class and write your logic to associate default role with logged in user.&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;

public class LoginPostAction extends Action {

&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;You can get logged in users details using PortalUtil.getUserId(request);&lt;br&gt;To know more about this check LoginPostAction inside portal source&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Jitendra Rajput</dc:creator>
    <dc:date>2013-01-10T07:12:45Z</dc:date>
  </entry>
  <entry>
    <title>How to set the default role when user log in in liferay 6.0 or 6.1</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=19088266" />
    <author>
      <name>Kiran Kumar Boyini</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=19088266</id>
    <updated>2013-01-10T07:00:24Z</updated>
    <published>2013-01-10T07:00:24Z</published>
    <summary type="html">Hi All,&lt;br /&gt;&lt;br /&gt;            I have requirement i.e., When the user logs in we have to assign one role as default role from the available roles related to him.&lt;br /&gt;And he has in role (default role) every time, when he logs.&lt;br /&gt;&lt;br /&gt;Tell me, how it is possible in simplest way.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;&lt;br /&gt;Kiran.</summary>
    <dc:creator>Kiran Kumar Boyini</dc:creator>
    <dc:date>2013-01-10T07:00:24Z</dc:date>
  </entry>
</feed>
