Forums de discussion

Liferay custom permissions - MODEL RESOURCE permission not appearing on UI

sri p, modifié il y a 9 années.

Liferay custom permissions - MODEL RESOURCE permission not appearing on UI

Junior Member Publications: 85 Date d'inscription: 22/01/11 Publications récentes
Hello All,


I could see the portlet resource permissions on the liferay ui but not model resource permissions. What I am missing ?
Scenario 1) I wanted to have two custom permissions so that different roles could see "Add/Update" links on my portlet.
Let's say there are two roles called LimitedAccount, AllAccount
LimitedAccount users should not be able to see "Add/Update" links, where as AllAccount users should see it.

Scenario 2) Same portlet on two different pages
on page one "Add/Update" links should be displayed , on page two "Add/Update" links should NOT be displayed.

I created new permission configuration xml and deployed. When I login as Admin to portal, I could see portlet resource permissions but NOT modal resource permissions.

NOTE: weight, root elements are not supported in liferay 6.1 ?? I do not have these elements below the model resource element

<!--?xml version="1.0"?-->

<resource-action-mapping>
	<portlet-resource>
		<portlet-name>Hospitalized</portlet-name>
		<permissions>
			<supports>
				<action-key>ADD_HOSPITALIZED_PL</action-key>
				<action-key>UPDATE_HOSPITALIZED_PL</action-key>
			</supports>
			<site-member-defaults />
			<guest-defaults />
			<guest-unsupported />
		</permissions>
	</portlet-resource>
	<model-resource>
                <model-name>com.axg.src</model-name>
                <portlet-ref>
                        <portlet-name>Hospitalized</portlet-name>
                </portlet-ref>
                <permissions>
                        <supports>
                                <action-key>ADD_HOSP</action-key>
                                <action-key>UPDATE_HOSP</action-key>
                        </supports>
                        <site-member-defaults />
                        <guest-defaults />
                        <guest-unsupported />
                </permissions>
        </model-resource>
</resource-action-mapping>


The following is what I see in liferay database




2301	Hospitalization_WAR	ADD_HOSPITALIZED_PL	32
2302	Hospitalization_WAR	UPDATE_HOSPITALIZED_PL	64
2303	com.axg.src	ADD_HOSP	2
2304	com.axg.src	UPDATE_HOSP	4
2305	com.axg.src	PERMISSIONS	8


Issue: I could see action.ADD_HOSPITALIZED_PL, action.UPDATE_HOSPITALIZED_PL when I navigate to roles and specific to Hospitalized portlet permissions. BUT I do not see ADD_HOSP, UPDATE_HOSP modal resource permissions. Any ideas ? I needed modal resource permissions because the same Hospitalized portlet added to two portal pages and "Add/Update" links should not be displayed on one of the pages


I hope I explained in the best way possible and appreciate all the help.
Please shed some light on this.

Thank you,
Sri
thumbnail
David H Nebinger, modifié il y a 9 années.

RE: Liferay custom permissions

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
1. In 6.2, when you are defining permissions for a role you choose site admin/applications/your portlet and you should see both the portlet perms and the model perms. I'm betting it's pretty close to the same way in 6.1.

2. This I would handle using a portlet param instead of a role. On the config page you can enable the links vs not enable, then in the regular view you check the portlet perm to see if the add/update links should be displayed.
sri p, modifié il y a 9 années.

RE: Liferay custom permissions

Junior Member Publications: 85 Date d'inscription: 22/01/11 Publications récentes
Thank you David for your response.

Liferay version in my case : 6.1.20 EE

1) I do not see model permissions in the portlet define permissions section.
com.axg.src is high level package contains portlets code which is defined web module, service code defined in service module.

So for the model-name element I provided "com.axg.src" package name as the value, but I am not seeing the model resource permissions.
Could you please tell me what package name should I specify for <model-name> ?

2) I am not sure about this. I could do this by looking at page name and set a request scope attribute to enable/disable links. But after reading on permissions I thought of using model resource package permission to do this.


The following is what I see in liferay data base.


2301	Hospitalization_WAR	ADD_HOSPITALIZED_PL	32
2302	Hospitalization_WAR	UPDATE_HOSPITALIZED_PL	64
2303	com.axg.src	ADD_HOSP	2
2304	com.axg.src	UPDATE_HOSP	4
2305	com.axg.src	PERMISSIONS	8


I appreciate your help.

Thank you,
Sri
Meena Peddi, modifié il y a 8 années.

RE: Liferay custom permissions

New Member Publications: 5 Date d'inscription: 11/06/15 Publications récentes
We have the requirement to disable the Permissions and Access from desktop icon from home icon in Documents and Media portlet for set of users.Can someone help me can we disable these options through permissions?
Thanks in advance
thumbnail
Manish Yadav, modifié il y a 6 années.

RE: Liferay custom permissions - MODEL RESOURCE permission not appearing on

Expert Publications: 493 Date d'inscription: 26/05/12 Publications récentes
have you achieved this ,I also have similar requirement to disable some options for specific roles