<?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>Please help - Checking permission</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=3266795" />
  <subtitle>Please help - Checking permission</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=3266795</id>
  <updated>2026-04-06T09:39:39Z</updated>
  <dc:date>2026-04-06T09:39:39Z</dc:date>
  <entry>
    <title>RE: Please help - Checking permission</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=3277302" />
    <author>
      <name>Victor Zorin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=3277302</id>
    <updated>2009-06-08T21:59:13Z</updated>
    <published>2009-06-08T21:59:13Z</published>
    <summary type="html">You&amp;#39;ve got to find the way to detect those bottlenecks in your configuration. Every setup is unique. Draw your diagram, analyze it, define and implement simple measurements at all cross-sections. Check your database and transaction tuning guide. Check sizes of connection pools, check maximum size of allowed connections on db end. To get better measurements, you may have to further spread your system (one system module per hardware node).  Check, how the change of configuration limits affects system performance, try to change limits in such way that similar performance degradation would start earlier. This way, it is going to be much easier to do analysis, i.e. less complex setup. Apply the same thinking approach as you do while writing the code.&lt;br /&gt;Usually, if such behavior is not intermittent, the explanation and fix (or workaround)  are quite simple.</summary>
    <dc:creator>Victor Zorin</dc:creator>
    <dc:date>2009-06-08T21:59:13Z</dc:date>
  </entry>
  <entry>
    <title>RE: Please help - Checking permission</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=3272954" />
    <author>
      <name>Sandeep Nair</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=3272954</id>
    <updated>2009-06-08T12:27:30Z</updated>
    <published>2009-06-08T12:27:30Z</published>
    <summary type="html">Thanks Victor,&lt;br /&gt;&lt;br /&gt;We did as you said and have done all those permission related code change in custom login post event class. It did help. But i have found that in clustered environment the performance decreases to a great magnitude than on single server. Do you have any idea about that?&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Sandeep</summary>
    <dc:creator>Sandeep Nair</dc:creator>
    <dc:date>2009-06-08T12:27:30Z</dc:date>
  </entry>
  <entry>
    <title>RE: Please help - Checking permission</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=3266858" />
    <author>
      <name>Victor Zorin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=3266858</id>
    <updated>2009-06-06T23:55:27Z</updated>
    <published>2009-06-06T23:55:27Z</published>
    <summary type="html">Sandeep, it is probably hard at the moment to analyze why the system is clogged, have a look at the approach described in this &lt;a href="http://www.liferay.com/web/guest/community/forums/-/message_boards/message/3248579"&gt;thread&lt;/a&gt;.&lt;br /&gt;What it does - it shifts the permissions analysis stage to the moment when user logs in, so you would have a system hit  only once per user instead of doing it at every consequent render call. For us, it works really well in both 5.1.2(4) and 5.2.1.</summary>
    <dc:creator>Victor Zorin</dc:creator>
    <dc:date>2009-06-06T23:55:27Z</dc:date>
  </entry>
  <entry>
    <title>Please help - Checking permission</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=3266794" />
    <author>
      <name>Sandeep Nair</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=3266794</id>
    <updated>2009-06-06T23:14:42Z</updated>
    <published>2009-06-06T23:14:42Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi friends,&lt;br&gt;&lt;br&gt;I am using liferay 5.1.2&lt;br&gt;&lt;br&gt;We had a requirement that when a user logs in he is able to see all his private pages as well as community private pages in the tabs. So i had written code to merge both layouts in ServicePreAction as under and its working fine.&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;try {
			List&amp;lt;group&amp;gt; userGroups = GroupLocalServiceUtil.getUserGroups(userId);
			_log.debug("Total usergroup size: "+userGroups.size());
			for(Group group: userGroups){

				String label = group.getTypeLabel();
				String name = group.getName();
				_log.debug("Name: "+group.getName()+" group Type: "+label+" url: "+group.getFriendlyURL());
				if(group.isCommunity()){
					List&amp;lt;layout&amp;gt; communityLayouts = LayoutLocalServiceUtil.getLayouts(
							group.getGroupId(), true);
					List&amp;lt;layout&amp;gt; viewableCommunityLayouts = new ArrayList&amp;lt;layout&amp;gt;();
					for(Layout communityLayout: communityLayouts){
//						boolean isViewable = LayoutPermissionUtil.contains(permissionChecker,communityLayout,ActionKeys.VIEW);
						boolean isViewable = true;
						//Only show community layouts if user is active, has agreed to Terms of use and not a password reset screen.
						if(isViewable &amp;amp;amp;&amp;amp;amp; user.isActive() &amp;amp;amp;&amp;amp;amp; user.getAgreedToTermsOfUse() &amp;amp;amp;&amp;amp;amp; !user.isPasswordReset()){
							viewableCommunityLayouts.add(communityLayout);
						}
					}
					communitylayouts.addAll(viewableCommunityLayouts);
					_log.debug("Groupt layouts size: "+communityLayouts.size()+" User Layouts size: "+viewableCommunityLayouts.size());
				}
				_log.debug("Group label: "+label);
				_log.debug("Group Name: "+ name);
			}
		}&amp;lt;/layout&amp;gt;&amp;lt;/layout&amp;gt;&amp;lt;/layout&amp;gt;&amp;lt;/group&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;The above code is working fine but during load test with roughly 60 users we found that it was taking hell of a time. On further investigation we found that the following line of code is taking more time&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;LayoutPermissionUtil.contains(permissionChecker,communityLayout,ActionKeys.VIEW);&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;I guess the reason being ServicePreAction being called on every request + there may be many community private pages.&lt;br&gt;&lt;br&gt;Is there a way to minimize the impact that is reduce the time??&lt;br&gt;&lt;br&gt;Please reply. Eagerly waiting for an answer.&lt;br&gt;&lt;br&gt;Regards,&lt;br&gt;Sandeep&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Sandeep Nair</dc:creator>
    <dc:date>2009-06-06T23:14:42Z</dc:date>
  </entry>
</feed>
