Fórumok

I don't understand what is an Action-key!

t d p, módosítva 15 év-val korábban

I don't understand what is an Action-key!

New Member Bejegyzés: 1 Csatlakozás dátuma: 2008.11.23. Legújabb bejegyzések
I'm a newbie in liferay and i am trying create a portlet.In this portlet,i want to limit some function if user hasn't login yet.So i view the sample "blogs" portlet of liferay.But when i view this code:

<?xml version="1.0"?>
<resource-action-mapping>
<portlet-resource>
<portlet-name>33</portlet-name>
<supports>
<action-key>ADD_ENTRY</action-key>
<action-key>CONFIGURATION</action-key>
<action-key>VIEW</action-key>
</supports>
<community-defaults>
<action-key>VIEW</action-key>
</community-defaults>
<guest-defaults>
<action-key>VIEW</action-key>
</guest-defaults>
<guest-unsupported>
<action-key>ADD_ENTRY</action-key>
</guest-unsupported>
</portlet-resource>
<model-resource>
<model-name>com.liferay.portlet.blogs.model.BlogsCategory</model-name>

I can not understand where is the source code what correctlative with an action-key , ex: ADD_ENTRY. And If i want create an new action-key, what is i had to do?

Thank you
thumbnail
Puj Z, módosítva 13 év-val korábban

RE: I don't understand what is an Action-key!

Regular Member Bejegyzések: 220 Csatlakozás dátuma: 2010.01.14. Legújabb bejegyzések
hi,

check the info on this page. It a tad old, but still gives you the idea:

http://content.liferay.com/4.0.0/docs/developers/ch07s03.html
thumbnail
Jan Gregor, módosítva 13 év-val korábban

RE: I don't understand what is an Action-key!

Regular Member Bejegyzések: 224 Csatlakozás dátuma: 2010.10.20. Legújabb bejegyzések
Hi, I think there are a couple of perfect WIKI articles that will answer all your questions : http://www.liferay.com/community/wiki/-/wiki/Main/Permissioning .
http://www.liferay.com/community/wiki/-/wiki/Main/Using+Liferay's+Permission+System+from+a+portlet

I was really surprised how much of Liferay functionality have a nice article in wiki, so guys, keep on good work!

To your questions:

The xml file that you have posted actually defines action keys = permissions, for your portlet & model.

Permissions for portlet is i.e Configuration, so some functionality part of a portlet that can be restricted to a role.

PErmission for a model is i.e add, update, edit, so actions, that can be done a special model (Class) defined for your application.

If you want to add a new permission (action key), just add a new entry to this file and redeploy your portlet. After deployment, Liferay will know, that there is such a permission defined for this portlet/model and will be available in system. More info can you find in the mentioned Article/search for more info in WIKI.

Good luck!
thumbnail
Mika Koivisto, módosítva 13 év-val korábban

RE: I don't understand what is an Action-key!

Liferay Legend Bejegyzések: 1519 Csatlakozás dátuma: 2006.08.07. Legújabb bejegyzések
This page from official documentation might help to understand permissioning.