Implemented course assign role as separate localib function