我正在尝试使用以下方法从角色中删除用户组。但它不起作用。有人能帮助我找出问题吗?
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;
}