flash(Constants.WARNING, "organization.member.isNotAMember");
return okWithLocation(routes.OrganizationApp.members(organizationName).url());
}
User currentUser = UserApp.currentUser();
if (!AccessControl.isAllowed(currentUser, organization.asResource(), Operation.UPDATE)) {
flash(Constants.WARNING, "organization.member.needManagerRole");
return okWithLocation(routes.OrganizationApp.members(organizationName).url());
}
if (OrganizationUser.isAdmin(organization.id, userId) && organization.getAdmins().size() == 1) {
flash(Constants.WARNING, "organization.member.atLeastOneAdmin");