public void addUserRole(String userId, IApplicationMetaInfo application, IRoleInstanceMetaInfo rm) throws DataModelException {
IUserRole role = userRoleDao.findRole(userId, application.getId(), rm.getId());
if (role != null) {
throw new DataModelException("Role is already assigned"); //$NON-NLS-1$
}
UserRole ur = new UserRole();
ur.setRoleInstanceMetaInfo(rm);
ur.setUserID(userId);
ur.setApplicationInfo(application);
userRoleDao.addUserRole(ur);
}