checkNotNullArgument(identity, "User");
checkNotNullArgument(group, "Group");
//TODO: add createRoleType switch to the API
IdentityObjectRelationship rel = getRepository().createRelationship(getInvocationContext(), createIdentityObject(group), createIdentityObject(identity), ROLE, roleType.getName(), false);
//TODO: null id - IdentityObjectRelationship doesn't have id
return new SimpleRole(new SimpleRoleType(rel.getName()), createUser(rel.getToIdentityObject()), createGroup(rel.getFromIdentityObject()));
}