Hello Pritesh,
It looks like you're using Liferay 6.0.x (from the schema used in liferay-portlet.xml)
Try adding the following to your default.xml:
1
2 <guest-defaults />
3 <guest-unsupported>
4 <action-key>ACCESS_IN_CONTROL_PANEL</action-key>
5 <action-key>ADD_TO_PAGE</action-key>
6 <action-key>VIEW</action-key>
7 </guest-unsupported>
For Liferay 6.1, you should instead use the following:
1<?xml version="1.0"?>
2<!DOCTYPE resource-action-mapping PUBLIC "-//Liferay//DTD Resource Action Mapping 6.1.0//EN" "http://www.liferay.com/dtd/liferay-resource-action-mapping_6_1_0.dtd">
3
4<resource-action-mapping>
5 <portlet-resource>
6 <portlet-name>my-hello-world-portlet</portlet-name>
7 <permissions>
8 <supports>
9 <action-key>ACCESS_IN_CONTROL_PANEL</action-key>
10 <action-key>ADD_TO_PAGE</action-key>
11 <action-key>VIEW</action-key>
12 </supports>
13 <site-member-defaults>
14 <action-key>ADD_TO_PAGE</action-key>
15 <action-key>VIEW</action-key>
16 </site-member-defaults>
17 <guest-defaults />
18 <guest-unsupported>
19 <action-key>ACCESS_IN_CONTROL_PANEL</action-key>
20 <action-key>ADD_TO_PAGE</action-key>
21 <action-key>VIEW</action-key>
22 </guest-unsupported>
23 </permissions>
24 </portlet-resource>
25</resource-action-mapping>
To hide the portlet for those who does not have permission, add the following to you liferay-portlet.xml:
1
2 <show-portlet-access-denied>false</show-portlet-access-denied>
Regards
/ Thomas