Fórum

Hook (ModelListener) for Role permission

thumbnail
Liferay Liferay, modificado 8 Anos atrás.

Hook (ModelListener) for Role permission

Junior Member Postagens: 55 Data de Entrada: 18/05/10 Postagens Recentes
Hi Liferay Gurus,

Can you please help me to capture the event for "define permissions" of a Role.

Steps
===
1. Goto Control Panel, and select Roles
2. Select a Role and select "Define Permissions"
3. Define any permission for that role and Save.

How to capture this event in Model Listener.

Thanks
-H
thumbnail
Pavel Savinov, modificado 8 Anos atrás.

RE: Hook (ModelListener) for Role permission (Resposta)

Junior Member Postagens: 54 Data de Entrada: 29/05/15 Postagens Recentes
Role permissions are com.liferay.portal.model.ResourcePermission, take a look on the following methods of your listener:

public void onAfterAddAssociation(Object classPK, String associationClassName, Object associationClassPK) throws ModelListenerException;

public void onAfterRemoveAssociation(Object classPK, String associationClassName, Object associationClassPK) throws ModelListenerException;


In those methods you can find out, which permission was assigned or removed.