掲示板

How to unassign/delete usergroup from role progmatically in Liferay 6.2

9年前 に Vimek Vanamali によって更新されました。

How to unassign/delete usergroup from role progmatically in Liferay 6.2

New Member 投稿: 16 参加年月日: 14/04/06 最新の投稿
Im trying to remove usergroup from role using the following method. But it doesnt work.Can some one help me to identify the problem

public static boolean deleteUserGroupFromRole( String groupName, String roleName )
{
try
{
company = CompanyLocalServiceUtil.getCompanyByMx( PropsUtil.get( PropsKeys.COMPANY_DEFAULT_WEB_ID ) );
long companyId = company.getCompanyId();

UserGroup lportalUserGroup= SoasLportalGroupHelper.getLportalUserGroup( groupName);
Role role= getRole( companyId, roleName );


GroupLocalServiceUtil.deleteRoleGroup(role.getRoleId(), lportalUserGroup.getGroupId() );

logger.debug( "Role : "+roleName +" has been deleted from groupName "+groupName);
return true;
}
catch ( PortalException e )
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch ( SystemException e )
{
// TODO Auto-generated catch block
e.printStackTrace();
}
return false;
}
thumbnail
9年前 に Pankaj Kathiriya によって更新されました。

RE: How to unassign/delete usergroup from role progmatically in Liferay 6.2

Liferay Master 投稿: 722 参加年月日: 10/08/05 最新の投稿
AFAIK, you have to use api methods of com.liferay.portal.service.UserGroupGroupRoleLocalServiceUtil.java class for that.

Regards
9年前 に Vimek Vanamali によって更新されました。

RE: How to unassign/delete usergroup from role progmatically in Liferay 6.2 (回答)

New Member 投稿: 16 参加年月日: 14/04/06 最新の投稿
Acutally the method works i was checking the wrong ui for the result (Useless me emoticonemoticonemoticonemoticonemoticon:angryemoticon
thumbnail
9年前 に Vishal Kumar によって更新されました。

RE: How to unassign/delete usergroup from role progmatically in Liferay 6.2

Regular Member 投稿: 198 参加年月日: 12/12/12 最新の投稿
Vimek Vanamali:
Acutally the method works i was checking the wrong ui for the result (Useless me emoticonemoticonemoticonemoticonemoticon:angryemoticon



emoticon