Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
t d p
I don't understand what is an Action-key!
25 de noviembre de 2008 9:26
Respuesta

t d p

Ranking: New Member

Mensajes: 1

Fecha de incorporación: 23 de noviembre de 2008

Mensajes recientes

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
Puj Z
RE: I don't understand what is an Action-key!
20 de noviembre de 2010 11:06
Respuesta

Puj Z

Ranking: Regular Member

Mensajes: 220

Fecha de incorporación: 14 de enero de 2010

Mensajes recientes

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
Jan Gregor
RE: I don't understand what is an Action-key!
20 de noviembre de 2010 11:47
Respuesta

Jan Gregor

Ranking: Regular Member

Mensajes: 224

Fecha de incorporación: 20 de octubre de 2010

Mensajes recientes

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!
Mika Koivisto
RE: I don't understand what is an Action-key!
23 de noviembre de 2010 17:41
Respuesta

Mika Koivisto

Ranking: Liferay Legend

Mensajes: 1518

Fecha de incorporación: 7 de agosto de 2006

Mensajes recientes

This page from official documentation might help to understand permissioning.

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!