Foros de discusión

LR6.2CEGA6 MySQL clearing non admin users

thumbnail
darren rose, modificado hace 7 años.

LR6.2CEGA6 MySQL clearing non admin users

Regular Member Mensajes: 215 Fecha de incorporación: 4/04/15 Mensajes recientes
Hi,

LR6.2CEGA6

I need to remove all users that do not have Administrator role.

Preference would be a groovy script run in the admin console.

regards
thumbnail
Amos Fong, modificado hace 7 años.

RE: LR6.2CEGA6 MySQL clearing non admin users

Liferay Legend Mensajes: 2047 Fecha de incorporación: 7/10/08 Mensajes recientes
Are you familiar with using the Liferay services in groovy?

You can get all users with UserLocalServiceUtil.getUsers(-1, -1).

Then just iterate over them and then iterate over user.getRoles() to see if they are an administrator.
thumbnail
darren rose, modificado hace 7 años.

RE: LR6.2CEGA6 MySQL clearing non admin users

Regular Member Mensajes: 215 Fecha de incorporación: 4/04/15 Mensajes recientes
Amos Fong:
Are you familiar with using the Liferay services in groovy?

You can get all users with UserLocalServiceUtil.getUsers(-1, -1).

Then just iterate over them and then iterate over user.getRoles() to see if they are an administrator.



Hi, yes, that works, thanks