@Permission(value={"member-add", "member-edit"}, userRequired=true, projectRequired=true)
public String doInviteAction(@RequestParam String emails, Model model,
@RequestParam Long roleId, @RequestAttr Project project, @RequestAttr User user) {
String[] emailsArray = StringUtils.split(emails, "\n");
for(String email : emailsArray) {
User tmp = userService.getUser(StringUtils.trim(email));
if(tmp!=null && NumberUtils.compare(tmp.getId(), user.getId())!=0) {
Role role = roleService.getRole(roleId);
TeamMember member = memberService.getMember(project, user);
if(member==null) {
member = new TeamMember(project, tmp, role);
member.setStatus(TeamMember.STATUS_NEED_ACCEPT);