@Override
public void assignUserRoles(String userId, String applicationId, List<IRoleInstanceMetaInfo> rm) throws ObjectNotFoundException {
ApplicationMetaInfo applicationMetaInfo = (ApplicationMetaInfo) appDao.getApplication(applicationId);
if (applicationMetaInfo == null) {
throw new ObjectNotFoundException("Application not found", applicationId); //$NON-NLS-1$
}
List<UserRole> userRole = getRolesForUser(userId, applicationId);
if (rm == null) {
List<IRoleInstanceMetaInfo> roles = getUserRoles(userId, applicationId);
for (IRoleInstanceMetaInfo role : roles) {