Foros de discusión

Forum - howto force users no permissions

thumbnail
Luca Costa, modificado hace 15 años.

Forum - howto force users no permissions

Junior Member Mensajes: 72 Fecha de incorporación: 5/03/08 Mensajes recientes
I'm trying to configure the forum in a way users of my portal can post threads but cannot set permission and cannot show them.

This is because posting an item the user can give change permission to guest to that post (guest can delete it),
and he also can enter and define permission in his post and he can view user names, internal structure of roles and groups and organizations, and so on...

Is there a way to set permission to block this issue? I think i'm doing something wrong...
Luca

P.S. in this way I can say there are more than 10.000 users in liferay site and their names, 12 organization, you use community roles, and so on...
thumbnail
Luca Costa, modificado hace 15 años.

RE: Forum - howto force users no permissions

Junior Member Mensajes: 72 Fecha de incorporación: 5/03/08 Mensajes recientes
Found a partial solution:

Remove from the portlet configuration all access from user community, then give to regular role "user" only rights to create new discussion, reply and create subcategory.

The only thing that remain is the hiding of the "permission - configure" panel that is under Tags panel.

Have ideas?
thumbnail
Ray Augé, modificado hace 15 años.

Re: [Liferay Forums][2. Using Liferay] Forum - howto force users no permiss

Liferay Legend Mensajes: 1197 Fecha de incorporación: 8/02/05 Mensajes recientes
The simples way to get around this limitation of the portal is to create
a class which implements:

[tt]com.liferay.portal.security.permission.PermissionsListFilter[/tt]

place the compiled class in a jar (or classes folder) somewhere either
in the global classloader (for tomcat: <tomcat>/lib/ext), or in the
portal classloader (webapps/ROOT/WEB-INF/[lib|classes]).

In that class you have a method:

[tt]public List<Permission> filterUserPermissions(
long companyId, long groupId, long userId, String name, String
primKey,
boolean portletActions, List<Permission> permissions)[/tt]

[tt]name[/tt]: is the "className" in most cases... (which allows you to
do something different per type).

SO, just remove Permissions which have action "PERMISSION" from the list
of Permissions for MBMessages (and MBCategories if you need).


HTH!
thumbnail
Mika Koivisto, modificado hace 12 años.

RE: Forum - howto force users no permissions

Liferay Legend Mensajes: 1519 Fecha de incorporación: 7/08/06 Mensajes recientes
Ray PermissionListFilter only works if you have permission algorithm 1 to 5. It's never called if you have algorithm 6.